hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f77bf3dd56653e0311c146d44641bf394ce42a1d | 119 | py | Python | Python/Templates/Web/ProjectTemplates/Python/Web/PollsFlask/__init__.py | mikiec84/PTVS | 6cbeadd70a4438d6e6ea4d22a465d678eacf5eb2 | [
"Apache-2.0"
] | 1 | 2019-06-05T19:16:49.000Z | 2019-06-05T19:16:49.000Z | Python/Templates/Web/ProjectTemplates/Python/Web/PollsFlask/__init__.py | anstkosh/PTVS | 1854ab3d6397e66765697bb63d898aec16d0406e | [
"Apache-2.0"
] | 2 | 2019-06-05T18:13:41.000Z | 2019-06-05T20:13:16.000Z | Python/Templates/Web/ProjectTemplates/Python/Web/PollsFlask/__init__.py | RaymonGulati1/PTVS | ee1d09f2a94be4e21016f7579205bb65ec82c616 | [
"Apache-2.0"
] | 2 | 2018-03-02T19:55:14.000Z | 2019-02-14T22:37:28.000Z | """
The flask application package.
"""
from flask import Flask
app = Flask(__name__)
import $safeprojectname$.views
| 11.9 | 30 | 0.739496 | """
The flask application package.
"""
from flask import Flask
app = Flask(__name__)
import $safeprojectname$.views
| false | true |
f77bf45b699f98dda8b03fc115f0a4d2ba1d6938 | 19,943 | py | Python | thunderfit/thunderfit/utilities.py | Mitchwatts93/thunderfit | a722d9160281cd0058c653181ab662b6988c714d | [
"MIT"
] | null | null | null | thunderfit/thunderfit/utilities.py | Mitchwatts93/thunderfit | a722d9160281cd0058c653181ab662b6988c714d | [
"MIT"
] | null | null | null | thunderfit/thunderfit/utilities.py | Mitchwatts93/thunderfit | a722d9160281cd0058c653181ab662b6988c714d | [
"MIT"
] | null | null | null | import logging
from json import dump as j_dumps
from json import load as j_load
from os import mkdir
from os.path import join, abspath
from time import strftime
import pandas as pd
from dill import dump as d_dump
from dill import load as d_load
from numpy import vstack, pad, diff, frombuffer, round, mean, nd... | 39.027397 | 201 | 0.626385 | import logging
from json import dump as j_dumps
from json import load as j_load
from os import mkdir
from os.path import join, abspath
from time import strftime
import pandas as pd
from dill import dump as d_dump
from dill import load as d_load
from numpy import vstack, pad, diff, frombuffer, round, mean, nd... | true | true |
f77bf625445a76bf73fbf3ccf0f95c6726d0c8f3 | 5,616 | py | Python | examples/CNN.py | INET-RC/HiPS | 9c9d84ab7e8ddcb6ecc3844823d2dc9617dd6c58 | [
"Apache-2.0"
] | 64 | 2021-05-02T14:42:34.000Z | 2021-05-06T01:35:03.000Z | examples/CNN.py | INET-RC/HiPS | 9c9d84ab7e8ddcb6ecc3844823d2dc9617dd6c58 | [
"Apache-2.0"
] | null | null | null | examples/CNN.py | INET-RC/HiPS | 9c9d84ab7e8ddcb6ecc3844823d2dc9617dd6c58 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache Licens... | 37.192053 | 89 | 0.632479 |
import time
import mxnet as mx
import argparse
import logging
from utils import load_data, get_batch, eval_acc, try_gpu
def main():
logging.basicConfig(level=logging.DEBUG)
parser = argparse.ArgumentParser()
parser.add_argument("-lr", "--learning_rate", type=float, default=0.01)
parser.add_argument... | true | true |
f77bf63549361787f59ad82d9b684afc0c6376a2 | 2,964 | py | Python | firmware/adafruit-circuitpython-bundle-5.x-mpy-20200915/examples/gizmo_tft_termometer.py | freeglow/microcontroller-cpy | 5adfda49da6eefaece81be2a2f26122d68736355 | [
"MIT"
] | null | null | null | firmware/adafruit-circuitpython-bundle-5.x-mpy-20200915/examples/gizmo_tft_termometer.py | freeglow/microcontroller-cpy | 5adfda49da6eefaece81be2a2f26122d68736355 | [
"MIT"
] | null | null | null | firmware/adafruit-circuitpython-bundle-5.x-mpy-20200915/examples/gizmo_tft_termometer.py | freeglow/microcontroller-cpy | 5adfda49da6eefaece81be2a2f26122d68736355 | [
"MIT"
] | null | null | null | """
This example will initialize the display using displayio and draw a bmp image
background, and overlay text containing the value read from the on-board temperature sensor.
User may press the A button to switch between celsius and fahrenheit units.
Required libraries:
* Adafruit_CircuitPython_Gizmo
* Adafruit... | 30.875 | 93 | 0.681849 | import time
from adafruit_circuitplayground import cp
import displayio
import terminalio
from adafruit_display_text import label
from adafruit_gizmo import tft_gizmo
display = tft_gizmo.TFT_Gizmo()
TEXT_SCALE = 2
old_a_val = cp.button_a
show_c_units = True
def c_to_f(c_val):
return (c_val *... | true | true |
f77bf70a240c3a458f5036ed3be53601040efdcf | 5,723 | py | Python | setup.py | LarsDu/SpaceGuppySfx | 1016cc828bac1b3292982a2470285bee6b27a787 | [
"MIT"
] | 2 | 2019-10-24T12:14:55.000Z | 2022-03-08T02:12:38.000Z | setup.py | LarsDu/SpaceGuppySfx | 1016cc828bac1b3292982a2470285bee6b27a787 | [
"MIT"
] | null | null | null | setup.py | LarsDu/SpaceGuppySfx | 1016cc828bac1b3292982a2470285bee6b27a787 | [
"MIT"
] | null | null | null | from os import environ, remove
from platform import uname
from os.path import join, isfile, exists
from subprocess import check_output
import kivy
if environ.get('KIVENT_USE_SETUPTOOLS'):
from setuptools import setup, Extension
print('Using setuptools')
else:
from distutils.core import setup
from dist... | 33.467836 | 88 | 0.653329 | from os import environ, remove
from platform import uname
from os.path import join, isfile, exists
from subprocess import check_output
import kivy
if environ.get('KIVENT_USE_SETUPTOOLS'):
from setuptools import setup, Extension
print('Using setuptools')
else:
from distutils.core import setup
from dist... | true | true |
f77bf730500af70ffedffb18b93725f0cd450d24 | 1,578 | py | Python | setup.py | nvonpentz/qless-py | 3eda4ffcd4c0016c9a7e44f780d6155e1a354dda | [
"MIT"
] | 20 | 2015-03-01T17:49:25.000Z | 2019-09-23T01:41:09.000Z | setup.py | nvonpentz/qless-py | 3eda4ffcd4c0016c9a7e44f780d6155e1a354dda | [
"MIT"
] | 40 | 2015-02-12T17:28:37.000Z | 2021-10-01T13:05:25.000Z | setup.py | nvonpentz/qless-py | 3eda4ffcd4c0016c9a7e44f780d6155e1a354dda | [
"MIT"
] | 12 | 2015-01-19T09:39:54.000Z | 2021-06-04T04:37:56.000Z | #! /usr/bin/env python
from setuptools import setup
setup(
name='qless-py',
version='0.11.4',
description='Redis-based Queue Management',
long_description='''
Redis-based queue management, with heartbeating, job tracking,
stats, notifications, and a whole lot more.''',
url='http://github.com/seomo... | 23.909091 | 62 | 0.534221 |
from setuptools import setup
setup(
name='qless-py',
version='0.11.4',
description='Redis-based Queue Management',
long_description='''
Redis-based queue management, with heartbeating, job tracking,
stats, notifications, and a whole lot more.''',
url='http://github.com/seomoz/qless-py',
author... | true | true |
f77bf73f7309750345842cbe98983710b9274fa3 | 571 | py | Python | Bioinformatics Stronghold/iprb.py | Amit-H/Rosalind-Problems | b0256b66fd1e3e6669899eb24ce5a7ed055e92f1 | [
"MIT"
] | null | null | null | Bioinformatics Stronghold/iprb.py | Amit-H/Rosalind-Problems | b0256b66fd1e3e6669899eb24ce5a7ed055e92f1 | [
"MIT"
] | null | null | null | Bioinformatics Stronghold/iprb.py | Amit-H/Rosalind-Problems | b0256b66fd1e3e6669899eb24ce5a7ed055e92f1 | [
"MIT"
] | null | null | null | from scipy.special import comb
def mendelian_probability(k, m, n):
'''
Calculates the chance of getting dominant alleles in a population
Input params:
k = homozygous dominant
m = heterozygous
n = homozygous recessive
'''
total_population = k + m + n
total_combinations = comb(total... | 25.954545 | 76 | 0.67951 | from scipy.special import comb
def mendelian_probability(k, m, n):
total_population = k + m + n
total_combinations = comb(total_population, 2)
dominant_combinations = comb(k, 2) + k*m + k*n + .5*m*n + .75*comb(m, 2)
probability = dominant_combinations/total_combinations
return probability
k = 19
... | true | true |
f77bf7cf38ab7839f3fb4ab6e497dd947e4e88c4 | 494 | py | Python | examples/quotes.py | miguelgrinberg/aio-executor | f4f63c838741538334ab4105340836410ff8e61b | [
"MIT"
] | 21 | 2019-12-29T23:56:54.000Z | 2020-12-03T15:15:15.000Z | examples/quotes.py | miguelgrinberg/aio-executor | f4f63c838741538334ab4105340836410ff8e61b | [
"MIT"
] | 1 | 2020-01-19T02:15:45.000Z | 2020-01-19T12:40:23.000Z | examples/quotes.py | miguelgrinberg/aio-executor | f4f63c838741538334ab4105340836410ff8e61b | [
"MIT"
] | 1 | 2020-06-25T11:47:46.000Z | 2020-06-25T11:47:46.000Z | import aiohttp
from flask import Flask
from aio_executor import run_with_asyncio
app = Flask(__name__)
async def get_random_quote():
async with aiohttp.ClientSession() as session:
async with session.get('https://api.quotable.io/random') as response:
quote = await response.json()
return f'... | 21.478261 | 77 | 0.692308 | import aiohttp
from flask import Flask
from aio_executor import run_with_asyncio
app = Flask(__name__)
async def get_random_quote():
async with aiohttp.ClientSession() as session:
async with session.get('https://api.quotable.io/random') as response:
quote = await response.json()
return f'... | true | true |
f77bf8e766e762c64112fec535b0a30936b1e3f7 | 44 | py | Python | diggrtoolbox/platform_mapping/__init__.py | diggr/diggrtoolbox | 25f5cf73d5bc4d3a54096aa8417a42025693f0b6 | [
"MIT"
] | 2 | 2018-08-31T22:02:04.000Z | 2019-01-25T15:51:04.000Z | diggrtoolbox/platform_mapping/__init__.py | diggr/diggrtoolbox | 25f5cf73d5bc4d3a54096aa8417a42025693f0b6 | [
"MIT"
] | null | null | null | diggrtoolbox/platform_mapping/__init__.py | diggr/diggrtoolbox | 25f5cf73d5bc4d3a54096aa8417a42025693f0b6 | [
"MIT"
] | null | null | null | from .platform_mapping import PlatformMapper | 44 | 44 | 0.909091 | from .platform_mapping import PlatformMapper | true | true |
f77bfa38e017cf0c6491e2fcde36b4ebe3a9c9bc | 952 | py | Python | test/test_analyzer.py | Quiltomics/godseye | 9650ffce958c215fb8d26a922df731e093d81aba | [
"Apache-2.0"
] | 5 | 2019-05-29T22:05:07.000Z | 2022-01-24T03:24:35.000Z | test/test_analyzer.py | Quiltomics/godseye | 9650ffce958c215fb8d26a922df731e093d81aba | [
"Apache-2.0"
] | 1 | 2018-05-22T06:26:32.000Z | 2018-05-22T06:26:37.000Z | test/test_analyzer.py | Bioquilt/godseye | 9650ffce958c215fb8d26a922df731e093d81aba | [
"Apache-2.0"
] | 1 | 2020-11-05T15:08:02.000Z | 2020-11-05T15:08:02.000Z | import pandas as pd
from test_importer import Importer
from functools import lru_cache
class Analyzer:
def __init__(self, *args, **kwargs):
self._importer = Importer(database_name=kwargs["database_name"])
self.data = self._importer.create_dataframe()
# Without maxsize the cache will preserve ... | 32.827586 | 87 | 0.662815 | import pandas as pd
from test_importer import Importer
from functools import lru_cache
class Analyzer:
def __init__(self, *args, **kwargs):
self._importer = Importer(database_name=kwargs["database_name"])
self.data = self._importer.create_dataframe()
@lru_cache
def filter(self, keywor... | true | true |
f77bfa5ce156033d165a64821f177638f4b9ca69 | 1,648 | py | Python | Main/perfomance_graph.py | Bastianleaf/TravellingSalesman | fafd7bb2e2ac79abc23bc261899e7d89cd0d8e9e | [
"Apache-2.0"
] | null | null | null | Main/perfomance_graph.py | Bastianleaf/TravellingSalesman | fafd7bb2e2ac79abc23bc261899e7d89cd0d8e9e | [
"Apache-2.0"
] | null | null | null | Main/perfomance_graph.py | Bastianleaf/TravellingSalesman | fafd7bb2e2ac79abc23bc261899e7d89cd0d8e9e | [
"Apache-2.0"
] | null | null | null | from Main.Tools import *
from time import time
import matplotlib.pyplot as plt
import numpy
#Parametros Globales
dataset_path = "../Data/ciudades_europa" # 1- "../Data/ciudades_europa 2- "../Data/region_metropolitana 3- "../Data/cities
origin_name = "Madrid" #Nombre de la ciudad, depende del dataset
population_siz... | 32.96 | 124 | 0.753641 | from Main.Tools import *
from time import time
import matplotlib.pyplot as plt
import numpy
dataset_path = "../Data/ciudades_europa" origin_name = "Madrid" #Nombre de la ciudad, depende del dataset
population_size = 20 #Individuos de poblacion
generations_number = 10 #Limite de generaciones identicas
## Creacio... | true | true |
f77bfc9abad2a0da063eed08ec915098fcecaed4 | 625 | py | Python | helpers/oldMakeLambdaScript/make_dockerfile.py | ryuxik/algostoreFE | 041a5a48580748da8500c470a3ce78940b98a9a3 | [
"MIT"
] | null | null | null | helpers/oldMakeLambdaScript/make_dockerfile.py | ryuxik/algostoreFE | 041a5a48580748da8500c470a3ce78940b98a9a3 | [
"MIT"
] | null | null | null | helpers/oldMakeLambdaScript/make_dockerfile.py | ryuxik/algostoreFE | 041a5a48580748da8500c470a3ce78940b98a9a3 | [
"MIT"
] | null | null | null |
def make_docker_file(language, algo_name, handler):
docker_setup = '# syntax=docker/dockerfile:1'
lambda_language = 'FROM public.ecr.aws/lambda/' + language
copy_reqs = 'COPY requirements.txt .'
run_reqs = 'RUN pip install -r requirements.txt'
copy_algo = 'COPY ' + algo_name + ' ./'
cmd_handler... | 36.764706 | 105 | 0.6576 |
def make_docker_file(language, algo_name, handler):
docker_setup = '# syntax=docker/dockerfile:1'
lambda_language = 'FROM public.ecr.aws/lambda/' + language
copy_reqs = 'COPY requirements.txt .'
run_reqs = 'RUN pip install -r requirements.txt'
copy_algo = 'COPY ' + algo_name + ' ./'
cmd_handler... | true | true |
f77bfd4d1c1d8c736c420485c458ec2e0e2495cc | 1,264 | py | Python | Stacks/Double Character Trouble.py | mr-mornin-star/problemSolving | c278e5d090af7370e56789e68b7bb73dc37165f8 | [
"Apache-2.0"
] | null | null | null | Stacks/Double Character Trouble.py | mr-mornin-star/problemSolving | c278e5d090af7370e56789e68b7bb73dc37165f8 | [
"Apache-2.0"
] | null | null | null | Stacks/Double Character Trouble.py | mr-mornin-star/problemSolving | c278e5d090af7370e56789e68b7bb73dc37165f8 | [
"Apache-2.0"
] | null | null | null | class Solution:
# @param A : string
# @return a strings
def solve(self, a):
stack=[]
for c in a:
if(len(stack)==0 or c!=stack[-1]):
stack.append(c)
else:
stack.pop()
return "".join(stack)
"""
Problem Description
You are give... | 17.802817 | 145 | 0.685127 | class Solution:
def solve(self, a):
stack=[]
for c in a:
if(len(stack)==0 or c!=stack[-1]):
stack.append(c)
else:
stack.pop()
return "".join(stack)
| true | true |
f77bfdaf2c429aab0cf951670bb2ab868533b19b | 12,125 | py | Python | nilearn/decomposition/canica.py | QinglinDong/nilearn-extenstion | 8eba7f29f1d5a788758514a639ed1c639041fe7d | [
"BSD-2-Clause"
] | null | null | null | nilearn/decomposition/canica.py | QinglinDong/nilearn-extenstion | 8eba7f29f1d5a788758514a639ed1c639041fe7d | [
"BSD-2-Clause"
] | 1 | 2018-10-21T15:10:41.000Z | 2018-10-21T15:10:41.000Z | nilearn/decomposition/canica.py | QinglinDong/nilearn-deep | 8eba7f29f1d5a788758514a639ed1c639041fe7d | [
"BSD-2-Clause"
] | 1 | 2020-01-02T22:44:36.000Z | 2020-01-02T22:44:36.000Z | """
CanICA
"""
# Author: Alexandre Abraham, Gael Varoquaux,
# License: BSD 3 clause
from operator import itemgetter
import numpy as np
from scipy.stats import scoreatpercentile
from sklearn.decomposition import fastica
from sklearn.externals.joblib import Memory, delayed, Parallel
from sklearn.utils import check_ran... | 38.492063 | 83 | 0.637608 |
from operator import itemgetter
import numpy as np
from scipy.stats import scoreatpercentile
from sklearn.decomposition import fastica
from sklearn.externals.joblib import Memory, delayed, Parallel
from sklearn.utils import check_random_state
from .multi_pca import MultiPCA
class CanICA(MultiPCA):
def __init... | true | true |
f77bfe10b462904e95bbaa9382ca133a2637fed1 | 81,644 | py | Python | tensorlayer/files/utils.py | yazdotai/tensorlayer | dea9d4023b578b4452c3861618e46466d4553658 | [
"Apache-2.0"
] | 1 | 2019-02-24T22:23:59.000Z | 2019-02-24T22:23:59.000Z | tensorlayer/files/utils.py | yazdotai/tensorlayer | dea9d4023b578b4452c3861618e46466d4553658 | [
"Apache-2.0"
] | null | null | null | tensorlayer/files/utils.py | yazdotai/tensorlayer | dea9d4023b578b4452c3861618e46466d4553658 | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/python
# -*- coding: utf-8 -*-
import os
import sys
import gzip
import math
import pickle
import progressbar
import re
import requests
import shutil
import tarfile
import time
import zipfile
from tqdm import tqdm
from six.moves import cPickle
# from six.moves import zip
from lxml import etree
import xm... | 37.641309 | 269 | 0.607626 |
import os
import sys
import gzip
import math
import pickle
import progressbar
import re
import requests
import shutil
import tarfile
import time
import zipfile
from tqdm import tqdm
from six.moves import cPickle
from lxml import etree
import xml.etree.ElementTree as ET
if sys.version_info[0] == 2:
from urllib... | true | true |
f77bfe57f0ed66727e69427bbef4920f387d2564 | 941 | py | Python | backend/core/docs.py | GCETTB-HYLAND-Hackathon2012-22/Miracurol-Rebuild | a6748e93b45872efdbaca013388dd6277824a9a5 | [
"Apache-2.0"
] | null | null | null | backend/core/docs.py | GCETTB-HYLAND-Hackathon2012-22/Miracurol-Rebuild | a6748e93b45872efdbaca013388dd6277824a9a5 | [
"Apache-2.0"
] | null | null | null | backend/core/docs.py | GCETTB-HYLAND-Hackathon2012-22/Miracurol-Rebuild | a6748e93b45872efdbaca013388dd6277824a9a5 | [
"Apache-2.0"
] | null | null | null | description = """
One platform for many solutions regarding health issues. 🚀




:
def __init__(self,nombre, apellido1, apellido2):
self.nombre=nombre
self.apellido1=apellido1
self.apellido2=apellido2
def saludo1(resquest): # primera vista
#nombr... | 32.508197 | 128 | 0.683308 | from django.http import HttpResponse
from django.template import Template, Context
import datetime
class Persona(object):
def __init__(self,nombre, apellido1, apellido2):
self.nombre=nombre
self.apellido1=apellido1
self.apellido2=apellido2
def saludo1(resquest): p1=Persona("Miguel... | true | true |
f77bfeadcf460800d3a1bb9fcdb8b6086760b3a3 | 175 | py | Python | main/start.py | gururajo/Self-Driving-Car | fecde52396df6c17e6948cc77ab9d17a524150d3 | [
"MIT"
] | null | null | null | main/start.py | gururajo/Self-Driving-Car | fecde52396df6c17e6948cc77ab9d17a524150d3 | [
"MIT"
] | null | null | null | main/start.py | gururajo/Self-Driving-Car | fecde52396df6c17e6948cc77ab9d17a524150d3 | [
"MIT"
] | null | null | null | from tensorflow_od_saved_model import *
camera = cv2.VideoCapture(0)
_,image_np=camera.read()
input_tensor = np.expand_dims(image_np, 0)
detections= detect_fn(input_tensor)
| 21.875 | 42 | 0.805714 | from tensorflow_od_saved_model import *
camera = cv2.VideoCapture(0)
_,image_np=camera.read()
input_tensor = np.expand_dims(image_np, 0)
detections= detect_fn(input_tensor)
| true | true |
f77bff5e6f236540d97625fc3cdea3399caaa4b2 | 20,502 | py | Python | jina/docker/hubio.py | musa-atlihan/jina | 9d9cbe1dad2703e2da10761a11c66abcc76dd8b8 | [
"Apache-2.0"
] | 2 | 2021-04-22T16:59:02.000Z | 2021-04-22T17:14:32.000Z | jina/docker/hubio.py | musa-atlihan/jina | 9d9cbe1dad2703e2da10761a11c66abcc76dd8b8 | [
"Apache-2.0"
] | null | null | null | jina/docker/hubio.py | musa-atlihan/jina | 9d9cbe1dad2703e2da10761a11c66abcc76dd8b8 | [
"Apache-2.0"
] | null | null | null | __copyright__ = "Copyright (c) 2020 Jina AI Limited. All rights reserved."
__license__ = "Apache-2.0"
import glob
import json
import urllib.parse
import urllib.request
import webbrowser
from typing import Dict
from .checker import *
from .database import MongoDBHandler
from .helper import handle_dot_in_keys
from ..cl... | 42.981132 | 120 | 0.559897 | __copyright__ = "Copyright (c) 2020 Jina AI Limited. All rights reserved."
__license__ = "Apache-2.0"
import glob
import json
import urllib.parse
import urllib.request
import webbrowser
from typing import Dict
from .checker import *
from .database import MongoDBHandler
from .helper import handle_dot_in_keys
from ..cl... | true | true |
f77c008c33d21dde5612d99f2c8ff77945786070 | 6,627 | py | Python | test_server.py | vicmortelmans/jquery.recurrenceinput.js | 1b78d1c5e892080c268a9e5f8bea6ee21d7881aa | [
"MIT"
] | null | null | null | test_server.py | vicmortelmans/jquery.recurrenceinput.js | 1b78d1c5e892080c268a9e5f8bea6ee21d7881aa | [
"MIT"
] | null | null | null | test_server.py | vicmortelmans/jquery.recurrenceinput.js | 1b78d1c5e892080c268a9e5f8bea6ee21d7881aa | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# This returns a formattedDate attribute on each occurrence,
# this is deprecated, as it requires i18n on both client and
# server side. Formatting is now done on the client side.
from wsgiref.simple_server import make_server
from wsgiref.util import setup_testing_defaults
from mimetypes... | 32.485294 | 105 | 0.554248 |
from wsgiref.simple_server import make_server
from wsgiref.util import setup_testing_defaults
from mimetypes import guess_type
import os
import sys
import SocketServer
import urlparse
import datetime
from dateutil import rrule
import json
import re
if len(sys.argv) > 1:
port = int(sys.argv[1])
... | false | true |
f77c02c2133c7254734ff1fc344bca035a8d73fb | 2,936 | py | Python | config.py | paullegranddc/gello | 9f8ce0e67e5da66cb8d26d01edc9a132bdfe8738 | [
"Apache-2.0"
] | 44 | 2018-03-28T14:22:23.000Z | 2022-03-15T07:25:06.000Z | config.py | paullegranddc/gello | 9f8ce0e67e5da66cb8d26d01edc9a132bdfe8738 | [
"Apache-2.0"
] | 44 | 2018-03-28T14:19:03.000Z | 2022-02-16T10:24:57.000Z | config.py | isabella232/gello | 3c7c6c72187095e3675b3ca15dcab8a2adaf44c0 | [
"Apache-2.0"
] | 12 | 2018-03-28T14:15:43.000Z | 2021-07-19T17:33:20.000Z | # -*- coding: utf-8 -*-
#
# Unless explicitly stated otherwise all files in this repository are licensed
# under the Apache 2 License.
#
# This product includes software developed at Datadog
# (https://www.datadoghq.com/).
#
# Copyright 2018 Datadog, Inc.
#
"""config.py
Configuration for the Flask application.
"""
... | 26.690909 | 78 | 0.661785 |
import os
from flask_dotenv import DotEnv
class Config:
APM_ENABLED = 'APM_ENABLED' in os.environ
BROKER_POOL_LIMIT = 0
CELERY_BROKER_URL = os.environ.get('REDIS_URL') or \
'redis://localhost:6379/0'
CELERY_RESULT_BACKEND = os.environ.get('REDIS_URL') or \
'redis://localhost:6379/0'... | true | true |
f77c039fc24f2409c147bb0627749b649c85cae0 | 5,121 | py | Python | ci/checks/check_copyright.py | billchenxi/ClaraGenomicsAnalysis | 544effc5881560de6d316f39c47c87014da14d70 | [
"Apache-2.0"
] | 1 | 2020-01-21T09:07:02.000Z | 2020-01-21T09:07:02.000Z | ci/checks/check_copyright.py | billchenxi/ClaraGenomicsAnalysis | 544effc5881560de6d316f39c47c87014da14d70 | [
"Apache-2.0"
] | 1 | 2020-07-17T13:57:56.000Z | 2020-07-17T13:57:56.000Z | ci/checks/check_copyright.py | billchenxi/ClaraGenomicsAnalysis | 544effc5881560de6d316f39c47c87014da14d70 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution... | 31.036364 | 87 | 0.657684 |
import argparse
import io
import os
import re
import stat
from subprocess import check_output
import sys
cpp_exts = {".hpp", ".cpp", ".cu", ".cuh", ".cc", ".h", ".c"}
cpp_copyright = r"""/*
* Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
*
* NVIDIA CORPORATION and its licensors retain all intellect... | true | true |
f77c042575532fcd70438e4f7ea5aff99f40aaf4 | 554 | py | Python | simplifyPath.py | cookie223/startingtocode | 04371e60091074faea7965831797c08590d28b7b | [
"MIT"
] | null | null | null | simplifyPath.py | cookie223/startingtocode | 04371e60091074faea7965831797c08590d28b7b | [
"MIT"
] | null | null | null | simplifyPath.py | cookie223/startingtocode | 04371e60091074faea7965831797c08590d28b7b | [
"MIT"
] | null | null | null | import re
import sys
def simplifyPath(Path):
Pathstore = re.split('/',Path)
Pathoutput = []
for item in Pathstore:
if item == '':
pass
elif item == '..':
try:
Pathoutput.pop()
except:
pass
elif item == '.':
... | 21.307692 | 35 | 0.472924 | import re
import sys
def simplifyPath(Path):
Pathstore = re.split('/',Path)
Pathoutput = []
for item in Pathstore:
if item == '':
pass
elif item == '..':
try:
Pathoutput.pop()
except:
pass
elif item == '.':
... | false | true |
f77c059ad078378241fcf594132f2bda5b6d587d | 7,736 | py | Python | luckyweb/server.py | bxtkezhan/luckyweb | 95fbff562a07d1ac01bff0a582cb55ab9370cb24 | [
"MIT"
] | 7 | 2018-11-25T06:15:30.000Z | 2019-05-20T14:47:24.000Z | luckyweb/server.py | bxtkezhan/luckyweb | 95fbff562a07d1ac01bff0a582cb55ab9370cb24 | [
"MIT"
] | null | null | null | luckyweb/server.py | bxtkezhan/luckyweb | 95fbff562a07d1ac01bff0a582cb55ab9370cb24 | [
"MIT"
] | 3 | 2018-11-25T06:17:33.000Z | 2019-03-14T12:29:01.000Z | import cgi
import os
import time
import mimetypes
from wsgiref.headers import Headers
import json
from wsgiref.simple_server import make_server
from http.cookies import SimpleCookie
def notfound_404(environ, start_response):
start_response('404 Not Found', [ ('Content-type', 'text/plain; charset=UTF-8') ])
re... | 38.108374 | 106 | 0.616986 | import cgi
import os
import time
import mimetypes
from wsgiref.headers import Headers
import json
from wsgiref.simple_server import make_server
from http.cookies import SimpleCookie
def notfound_404(environ, start_response):
start_response('404 Not Found', [ ('Content-type', 'text/plain; charset=UTF-8') ])
re... | true | true |
f77c05d83105c848708ca3c6b46f67bfb996b789 | 4,611 | py | Python | tests/pytest/math_tests/test_trigonometric.py | SX-Aurora/nlcpy | 0a53eec8778073bc48b12687b7ce37ab2bf2b7e0 | [
"BSD-3-Clause"
] | 11 | 2020-07-31T02:21:55.000Z | 2022-03-10T03:12:11.000Z | tests/pytest/math_tests/test_trigonometric.py | SX-Aurora/nlcpy | 0a53eec8778073bc48b12687b7ce37ab2bf2b7e0 | [
"BSD-3-Clause"
] | null | null | null | tests/pytest/math_tests/test_trigonometric.py | SX-Aurora/nlcpy | 0a53eec8778073bc48b12687b7ce37ab2bf2b7e0 | [
"BSD-3-Clause"
] | null | null | null | #
# * The source code in this file is based on the soure code of CuPy.
#
# # NLCPy License #
#
# Copyright (c) 2020-2021 NEC Corporation
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are ... | 40.095652 | 88 | 0.702451 |
import unittest
from nlcpy import testing
@testing.parameterize(*(
testing.product({
'shape': [(2,), (2, 3), (2, 3, 4)],
})
))
class TestTrigonometric(unittest.TestCase):
@testing.for_all_dtypes(no_bool=True)
@testing.numpy_nlcpy_allclose(atol=1e-5)
def check_unary(self, name, xp, dtype... | true | true |
f77c068084f45769a7fd43ea21cec311b40055d1 | 6,062 | py | Python | ZSSGAN/mapper/training/ranger.py | anon-paper-github/cvpr-641 | d969e2a3ca002bee9d9320d0ee33802b2f532742 | [
"MIT"
] | null | null | null | ZSSGAN/mapper/training/ranger.py | anon-paper-github/cvpr-641 | d969e2a3ca002bee9d9320d0ee33802b2f532742 | [
"MIT"
] | null | null | null | ZSSGAN/mapper/training/ranger.py | anon-paper-github/cvpr-641 | d969e2a3ca002bee9d9320d0ee33802b2f532742 | [
"MIT"
] | null | null | null | # Ranger deep learning optimizer - RAdam + Lookahead + Gradient Centralization, combined into one optimizer.
# https://github.com/lessw2020/Ranger-Deep-Learning-Optimizer
# and/or
# https://github.com/lessw2020/Best-Deep-Learning-Optimizers
# Ranger has now been used to capture 12 records on the FastAI leaderbo... | 36.963415 | 170 | 0.664302 |
import math
import torch
from torch.optim.optimizer import Optimizer
class Ranger(Optimizer):
def __init__(self, params, lr=1e-3, alpha=0.5, k=6, N_sma_threshhold=5, betas=(.95, 0.999), eps=1e-5, weight_decay=0, use_gc=True, gc_conv_only=False
):
if not 0.0 <= ... | true | true |
f77c069517926edf820766364ac9d5b803541f03 | 1,747 | py | Python | src/NCAAClassification.py | parekhmitchell/NCAA-ML | f075448e89b993a8515d02ab52bec1fb0ac3c020 | [
"MIT"
] | null | null | null | src/NCAAClassification.py | parekhmitchell/NCAA-ML | f075448e89b993a8515d02ab52bec1fb0ac3c020 | [
"MIT"
] | null | null | null | src/NCAAClassification.py | parekhmitchell/NCAA-ML | f075448e89b993a8515d02ab52bec1fb0ac3c020 | [
"MIT"
] | null | null | null | # Toolkit used for Classification
# Importing Libraries
from sklearn.linear_model import LogisticRegression
from sklearn.svm import SVC
from sklearn.ensemble import RandomForestClassifier
# Logistic Regression Classification
def logRegress(X_train, y_train, X_test, y_test):
# Fitting Logistic Regression to the Tr... | 29.116667 | 99 | 0.692044 |
from sklearn.linear_model import LogisticRegression
from sklearn.svm import SVC
from sklearn.ensemble import RandomForestClassifier
def logRegress(X_train, y_train, X_test, y_test):
classifier = LogisticRegression(random_state = 0)
classifier.fit(X_train, y_train)
y_pred = classifier.predict(... | true | true |
f77c069faa053cd0ca90103aad852e2255a198d4 | 2,759 | py | Python | sidserver/service.py | UTSA-ICS/sid-server | 21a09204975dc54d6cba843233708e43bf9830d0 | [
"Apache-2.0"
] | null | null | null | sidserver/service.py | UTSA-ICS/sid-server | 21a09204975dc54d6cba843233708e43bf9830d0 | [
"Apache-2.0"
] | null | null | null | sidserver/service.py | UTSA-ICS/sid-server | 21a09204975dc54d6cba843233708e43bf9830d0 | [
"Apache-2.0"
] | null | null | null | # Copyright 2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | 31 | 79 | 0.650236 |
import functools
import sys
from oslo_config import cfg
from oslo_log import log
from paste import deploy
import routes
from sidserver.common import wsgi
from sidserver import controllers
from sidserver import routers
from sidserver import aws
from sidserver import azure
CONF = cfg.CONF
LOG = log.getLogger(__name_... | true | true |
f77c075432746b1490cf5f5c1ae0a646978ad094 | 515 | py | Python | openprocurement/auctions/flash/views/auction.py | openprocurement/openprocurement.auctions.flash | 29d6b9e558cda9d050592136488c00e20bfa37dd | [
"Apache-2.0"
] | null | null | null | openprocurement/auctions/flash/views/auction.py | openprocurement/openprocurement.auctions.flash | 29d6b9e558cda9d050592136488c00e20bfa37dd | [
"Apache-2.0"
] | 53 | 2016-07-05T11:46:16.000Z | 2019-02-20T12:12:14.000Z | openprocurement/auctions/flash/views/auction.py | openprocurement/openprocurement.auctions.flash | 29d6b9e558cda9d050592136488c00e20bfa37dd | [
"Apache-2.0"
] | 11 | 2016-07-05T11:14:09.000Z | 2018-05-30T07:10:37.000Z | # -*- coding: utf-8 -*-
from openprocurement.auctions.core.utils import opresource
from openprocurement.auctions.core.views.mixins import AuctionAuctionResource
@opresource(name='belowThreshold:Auction Auction',
collection_path='/auctions/{auction_id}/auction',
path='/auctions/{auction_id}/auc... | 39.615385 | 77 | 0.741748 | from openprocurement.auctions.core.utils import opresource
from openprocurement.auctions.core.views.mixins import AuctionAuctionResource
@opresource(name='belowThreshold:Auction Auction',
collection_path='/auctions/{auction_id}/auction',
path='/auctions/{auction_id}/auction/{auction_lot_id}',
... | true | true |
f77c0776159d7a6363cf7e431bbaf7956291d718 | 9,540 | py | Python | tests/test_core.py | NamoxLabs/saleor | 558de3985903133660e97d8a436b374c405a2fa1 | [
"BSD-3-Clause"
] | 3 | 2019-04-17T01:00:47.000Z | 2019-05-09T01:45:50.000Z | tests/test_core.py | NamoxLabs/saleor | 558de3985903133660e97d8a436b374c405a2fa1 | [
"BSD-3-Clause"
] | 1 | 2020-02-11T23:33:14.000Z | 2020-02-11T23:33:14.000Z | tests/test_core.py | NamoxLabs/saleor | 558de3985903133660e97d8a436b374c405a2fa1 | [
"BSD-3-Clause"
] | 1 | 2021-04-22T12:10:35.000Z | 2021-04-22T12:10:35.000Z | import io
from contextlib import redirect_stdout
from unittest.mock import Mock, patch
from urllib.parse import urljoin
import pytest
from django.db.models import Case, F, When
from django.shortcuts import reverse
from django.templatetags.static import static
from django.urls import translate_url
from measurement.mea... | 35.333333 | 89 | 0.70608 | import io
from contextlib import redirect_stdout
from unittest.mock import Mock, patch
from urllib.parse import urljoin
import pytest
from django.db.models import Case, F, When
from django.shortcuts import reverse
from django.templatetags.static import static
from django.urls import translate_url
from measurement.mea... | true | true |
f77c079b1180e9e3ab80bc6829a7300a28d605c4 | 912 | py | Python | website/models.py | Fbossio/Contacts | 51d62a89909dda7c39dc3d8e825d3797b5709a54 | [
"MIT"
] | null | null | null | website/models.py | Fbossio/Contacts | 51d62a89909dda7c39dc3d8e825d3797b5709a54 | [
"MIT"
] | null | null | null | website/models.py | Fbossio/Contacts | 51d62a89909dda7c39dc3d8e825d3797b5709a54 | [
"MIT"
] | null | null | null | from . import db
from flask_login import UserMixin
class User(db.Model, UserMixin):
__tablename__ = 'users'
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(150), nullable=False)
email = db.Column(db.String(150), unique=True, nullable=False)
password = db.Column(db.String(15... | 32.571429 | 69 | 0.669956 | from . import db
from flask_login import UserMixin
class User(db.Model, UserMixin):
__tablename__ = 'users'
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(150), nullable=False)
email = db.Column(db.String(150), unique=True, nullable=False)
password = db.Column(db.String(15... | true | true |
f77c09baee749cc3b1c1fe62e0505249dd667aee | 715 | py | Python | djangoblog/spider_notify.py | n1celll/DjangoBlog | c7541202e53001d0baa887004b02a6f0a84a1aec | [
"MIT"
] | 5,052 | 2016-11-06T15:51:59.000Z | 2022-03-31T03:42:50.000Z | djangoblog/spider_notify.py | gold9527/DjangoBlog | 6512ab7542c96364f593b9be221cdc74ecfa6a0d | [
"MIT"
] | 497 | 2017-03-24T02:57:29.000Z | 2022-03-31T03:21:16.000Z | djangoblog/spider_notify.py | gold9527/DjangoBlog | 6512ab7542c96364f593b9be221cdc74ecfa6a0d | [
"MIT"
] | 2,565 | 2016-11-06T15:56:33.000Z | 2022-03-31T14:15:31.000Z | import logging
import requests
from django.conf import settings
from django.contrib.sitemaps import ping_google
logger = logging.getLogger(__name__)
class SpiderNotify():
@staticmethod
def baidu_notify(urls):
try:
data = '\n'.join(urls)
result = requests.post(settings.BAIDU_N... | 22.34375 | 72 | 0.633566 | import logging
import requests
from django.conf import settings
from django.contrib.sitemaps import ping_google
logger = logging.getLogger(__name__)
class SpiderNotify():
@staticmethod
def baidu_notify(urls):
try:
data = '\n'.join(urls)
result = requests.post(settings.BAIDU_N... | true | true |
f77c0a7483b98b553222f0b51625c37211b09e8b | 751 | py | Python | cli/setup.py | toebes/onshape-clients | a26cf6a77cfc7901321e603d5a097e23eb51e35c | [
"MIT"
] | 14 | 2019-06-23T08:47:41.000Z | 2021-11-29T16:28:45.000Z | cli/setup.py | toebes/onshape-clients | a26cf6a77cfc7901321e603d5a097e23eb51e35c | [
"MIT"
] | 40 | 2019-05-22T14:39:46.000Z | 2022-03-10T10:36:17.000Z | cli/setup.py | toebes/onshape-clients | a26cf6a77cfc7901321e603d5a097e23eb51e35c | [
"MIT"
] | 24 | 2019-06-02T01:03:41.000Z | 2022-03-29T13:25:36.000Z | # coding: utf-8
"""
Onshape Clients CLI
The CLI for managing the Onshape Clients.
"""
from setuptools import setup, find_packages # noqa: H301
import os
NAME = "cli"
REQUIRES = ["click", "twine", "black"]
setup(
name=NAME,
version="0.0.0",
description="Onshape Clients CLI",
author_email="... | 22.757576 | 73 | 0.663116 |
from setuptools import setup, find_packages import os
NAME = "cli"
REQUIRES = ["click", "twine", "black"]
setup(
name=NAME,
version="0.0.0",
description="Onshape Clients CLI",
author_email="api-support@onshape.zendesk.com",
url="",
keywords=["CLI", "Onshape Clients CLI"],
install_requi... | true | true |
f77c0a85ce5fac63672ca04bf0bc7b2fc5dff035 | 1,807 | py | Python | Python/WigBedToCustomBed.py | bmorledge-hampton19/project_protista | 5308daa616ebac62e84c5191119e9089d1b2d5b7 | [
"MIT"
] | null | null | null | Python/WigBedToCustomBed.py | bmorledge-hampton19/project_protista | 5308daa616ebac62e84c5191119e9089d1b2d5b7 | [
"MIT"
] | null | null | null | Python/WigBedToCustomBed.py | bmorledge-hampton19/project_protista | 5308daa616ebac62e84c5191119e9089d1b2d5b7 | [
"MIT"
] | null | null | null | # This script takes a bed file that is the result of the wig2bed operation and converts it to the bed format expected by mutperiod.
from mutperiodpy.helper_scripts.UsefulFileSystemFunctions import DataTypeStr, getDataDirectory
from mutperiodpy.Tkinter_scripts.TkinterDialog import TkinterDialog
from typing import List
i... | 40.155556 | 131 | 0.676259 | from mutperiodpy.helper_scripts.UsefulFileSystemFunctions import DataTypeStr, getDataDirectory
from mutperiodpy.Tkinter_scripts.TkinterDialog import TkinterDialog
from typing import List
import os
def wigBedToCustomBed(wigBedFilePaths: List[str]):
for wigBedFilePath in wigBedFilePaths:
print("Working in... | true | true |
f77c0b077b2149c677531da0ccd101c054610e4d | 970 | py | Python | sa/profiles/Upvel/UP/get_arp.py | ewwwcha/noc | aba08dc328296bb0e8e181c2ac9a766e1ec2a0bb | [
"BSD-3-Clause"
] | 1 | 2019-09-20T09:36:48.000Z | 2019-09-20T09:36:48.000Z | sa/profiles/Upvel/UP/get_arp.py | ewwwcha/noc | aba08dc328296bb0e8e181c2ac9a766e1ec2a0bb | [
"BSD-3-Clause"
] | null | null | null | sa/profiles/Upvel/UP/get_arp.py | ewwwcha/noc | aba08dc328296bb0e8e181c2ac9a766e1ec2a0bb | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# ---------------------------------------------------------------------
# Upvel.UP.get_arp
# ---------------------------------------------------------------------
# Copyright (C) 2007-2018 The NOC Project
# See LICENSE for details
# ---------------------------------------------------------------... | 31.290323 | 99 | 0.445361 | from noc.core.script.base import BaseScript
from noc.sa.interfaces.igetarp import IGetARP
import re
class Script(BaseScript):
name = "Upvel.UP.get_arp"
interface = IGetARP
rx_line = re.compile(
r"^(?P<ip>[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)\s+via\s+(?P<interface>\S+):" r"(?P<mac>\S+)\s*$",
re.M... | true | true |
f77c0c1da3795084e38c6fe6a34c5a279ffdc162 | 501 | py | Python | utils/deployUtils/random_choose.py | echohermion/smartbugs | 81643cdd5b1eb7c66c6d162ff6f76daaabd75835 | [
"Apache-2.0"
] | null | null | null | utils/deployUtils/random_choose.py | echohermion/smartbugs | 81643cdd5b1eb7c66c6d162ff6f76daaabd75835 | [
"Apache-2.0"
] | null | null | null | utils/deployUtils/random_choose.py | echohermion/smartbugs | 81643cdd5b1eb7c66c6d162ff6f76daaabd75835 | [
"Apache-2.0"
] | null | null | null | import os
import random
import shutil
def chooseFile(filepath, tarpath):
filedir = os.listdir(filepath)
sample = random.sample(filedir, 500) # random choose 500 contracts
for s in sample:
shutil.copyfile(filepath+"/" + s, tarpath+ "/" +s)
if __name__ == '__main__':
filepath = "/Users/luliu/... | 27.833333 | 72 | 0.714571 | import os
import random
import shutil
def chooseFile(filepath, tarpath):
filedir = os.listdir(filepath)
sample = random.sample(filedir, 500)
for s in sample:
shutil.copyfile(filepath+"/" + s, tarpath+ "/" +s)
if __name__ == '__main__':
filepath = "/Users/luliu/PycharmProjects/my_smartbugs/c... | true | true |
f77c0dac94c9dc0399b6020c22d51c39cb1ab781 | 620 | py | Python | src/scripts/snapshot.py | rumble-kong-league/snapshot-kong-holders | 4d8d8f224b1b95c867f4952fb71c118a3d916dd8 | [
"MIT"
] | null | null | null | src/scripts/snapshot.py | rumble-kong-league/snapshot-kong-holders | 4d8d8f224b1b95c867f4952fb71c118a3d916dd8 | [
"MIT"
] | null | null | null | src/scripts/snapshot.py | rumble-kong-league/snapshot-kong-holders | 4d8d8f224b1b95c867f4952fb71c118a3d916dd8 | [
"MIT"
] | 1 | 2022-02-22T20:58:51.000Z | 2022-02-22T20:58:51.000Z | from brownie import interface
from datetime import datetime
import json
TOTAL_SUPPLY = 10_000
def main():
# address => [token_id]
owners = {}
rkl = interface.IRumbleKongLeague("0xef0182dc0574cd5874494a120750fd222fdb909a")
for i in range(TOTAL_SUPPLY):
print(i)
owner = rkl.ownerOf(i)
... | 20.666667 | 83 | 0.617742 | from brownie import interface
from datetime import datetime
import json
TOTAL_SUPPLY = 10_000
def main():
owners = {}
rkl = interface.IRumbleKongLeague("0xef0182dc0574cd5874494a120750fd222fdb909a")
for i in range(TOTAL_SUPPLY):
print(i)
owner = rkl.ownerOf(i)
if owner in own... | true | true |
f77c0dd1b7383a7f21dbe64db8b79fb721d48971 | 4,814 | py | Python | tools/mt_tracer.py | imandr/pythreader | 33e3334c5df3a6487897d6f9db57b702351b4f69 | [
"BSD-3-Clause"
] | null | null | null | tools/mt_tracer.py | imandr/pythreader | 33e3334c5df3a6487897d6f9db57b702351b4f69 | [
"BSD-3-Clause"
] | null | null | null | tools/mt_tracer.py | imandr/pythreader | 33e3334c5df3a6487897d6f9db57b702351b4f69 | [
"BSD-3-Clause"
] | null | null | null | #
# Thread safe version
#
# Usage:
#
# 1. Create record keeper object in the main thread:
#
# keeper = TraceRecordKeeper()
#
# 2. Pass the keeper reference to each thread and have them create their own tracers:
#
# class MyThread(Thread):
# def __init__(self, ..., trace_keeper, ...):
# ...
# ... | 26.306011 | 85 | 0.490445 |
import time
from pythreader import Primitive, synchronized
class ContextProxy:
def __init__(self, tracer, context):
self.Context = context
self.Tracer = tracer
def __enter__(self):
self.T0 = time.time()
def __exit__(self, *params):
t = time.ti... | false | true |
f77c0dda132bff808396e8898dad72b02f82c664 | 1,856 | py | Python | i3pystatus/keyboard_locks.py | crwood/i3pystatus | 0e7e04f075afb73be1a71d3ad2fc5b0d33bb9214 | [
"MIT"
] | null | null | null | i3pystatus/keyboard_locks.py | crwood/i3pystatus | 0e7e04f075afb73be1a71d3ad2fc5b0d33bb9214 | [
"MIT"
] | null | null | null | i3pystatus/keyboard_locks.py | crwood/i3pystatus | 0e7e04f075afb73be1a71d3ad2fc5b0d33bb9214 | [
"MIT"
] | 1 | 2019-08-15T10:35:54.000Z | 2019-08-15T10:35:54.000Z | import subprocess
from i3pystatus import IntervalModule
class Keyboard_locks(IntervalModule):
"""
Shows the status of CAPS LOCK, NUM LOCK and SCROLL LOCK
Available formatters:
* `{caps}` — the current status of CAPS LOCK
* `{num}` — the current status of NUM LOCK
* `{scroll}` — the current ... | 30.933333 | 77 | 0.577586 | import subprocess
from i3pystatus import IntervalModule
class Keyboard_locks(IntervalModule):
interval = 1
settings = (
("format", "Format string. "
"Available formaters are {core} and {usage}."),
("caps_on", "String to show in {caps} when CAPS LOCK is on"),
("caps_off",... | true | true |
f77c0e6ac1bd6b9c34c0d2d474c653895e99e94b | 60 | py | Python | ex50.py | cohadar/learn-python-the-hard-way | 10d88fe59a8abc5303661cfe91c6db9fa71bdd56 | [
"MIT"
] | null | null | null | ex50.py | cohadar/learn-python-the-hard-way | 10d88fe59a8abc5303661cfe91c6db9fa71bdd56 | [
"MIT"
] | null | null | null | ex50.py | cohadar/learn-python-the-hard-way | 10d88fe59a8abc5303661cfe91c6db9fa71bdd56 | [
"MIT"
] | null | null | null | # ah but I am not interested in web development with python! | 60 | 60 | 0.783333 | true | true | |
f77c0f0bc7c72fad50f3f98396611618d05ffc73 | 79 | py | Python | Colour.py | nurialozano/nlgammon | 96263fffa3b8275505fec131b4950ed8bca884f1 | [
"MIT"
] | null | null | null | Colour.py | nurialozano/nlgammon | 96263fffa3b8275505fec131b4950ed8bca884f1 | [
"MIT"
] | null | null | null | Colour.py | nurialozano/nlgammon | 96263fffa3b8275505fec131b4950ed8bca884f1 | [
"MIT"
] | null | null | null | import enum
class Colour(enum.Enum):
BLACK = 0
WHITE = 1
| 7.9 | 25 | 0.518987 | import enum
class Colour(enum.Enum):
BLACK = 0
WHITE = 1
| true | true |
f77c0fa62620790256ff511802b3df895ed619cf | 1,562 | py | Python | chapters/04_machine_learning_basics/generic.py | Asurada2015/TF-_for_MI | 5fafdb78286b122036fa9aecf2a4be72ea4673e1 | [
"Apache-2.0"
] | 8 | 2018-01-09T05:29:01.000Z | 2019-03-03T13:40:51.000Z | chapters/04_machine_learning_basics/generic.py | Asurada2015/TF-_for_MI | 5fafdb78286b122036fa9aecf2a4be72ea4673e1 | [
"Apache-2.0"
] | null | null | null | chapters/04_machine_learning_basics/generic.py | Asurada2015/TF-_for_MI | 5fafdb78286b122036fa9aecf2a4be72ea4673e1 | [
"Apache-2.0"
] | 6 | 2017-10-25T02:17:59.000Z | 2018-11-08T01:58:32.000Z | # TF code scaffolding for building simple models.
# 为模型训练和评估定义一个通用的代码框架
import tensorflow as tf
# 初始化变量和模型参数,定义训练闭环中的运算
# initialize variables/model parameters
# define the training loop operations
def inference(X):
# compute inference model over data X and return the result
# 计算推断模型在数据X上的输出,并将结果返回
return... | 23.313433 | 100 | 0.693342 | import tensorflow as tf
def inference(X):
return
def loss(X, Y):
return
def inputs():
return
def train(total_loss):
return
def evaluate(sess, X, Y):
return
with tf.Session() as sess:
tf.initialize_all_variables().run()
X, Y = inputs()
... | true | true |
f77c0fbeefb9e279fe9a62056c667c852b9ce163 | 415 | py | Python | pyquantfinance/decorators.py | anthonyfong100/Pynance | 1777857375e92150f0057dd02ba8d770cbf9272f | [
"MIT"
] | 2 | 2020-04-28T14:25:47.000Z | 2021-09-16T08:47:02.000Z | pyquantfinance/decorators.py | anthonyfong100/Pynance | 1777857375e92150f0057dd02ba8d770cbf9272f | [
"MIT"
] | 5 | 2020-04-19T05:47:48.000Z | 2020-06-09T09:58:26.000Z | pyquantfinance/decorators.py | anthonyfong100/Pynance | 1777857375e92150f0057dd02ba8d770cbf9272f | [
"MIT"
] | null | null | null | def accepts(*types):
def check_accepts(f):
assert len(types) == f.__code__.co_argcount
def new_f(*args, **kwds):
for (a, t) in zip(args, types):
if not isinstance(a, t):
raise TypeError("arg %r does not match type %s" % (a, t))
return f(*a... | 31.923077 | 77 | 0.53494 | def accepts(*types):
def check_accepts(f):
assert len(types) == f.__code__.co_argcount
def new_f(*args, **kwds):
for (a, t) in zip(args, types):
if not isinstance(a, t):
raise TypeError("arg %r does not match type %s" % (a, t))
return f(*a... | true | true |
f77c0ffa0f30dfe07a1b24adeda70f7ed23b9181 | 2,473 | py | Python | examples/beeliza/beeliza/app.py | d3r3kk/toga | 2d8c0eb30371c4ef4f0610251233569e9c618e93 | [
"BSD-3-Clause"
] | null | null | null | examples/beeliza/beeliza/app.py | d3r3kk/toga | 2d8c0eb30371c4ef4f0610251233569e9c618e93 | [
"BSD-3-Clause"
] | null | null | null | examples/beeliza/beeliza/app.py | d3r3kk/toga | 2d8c0eb30371c4ef4f0610251233569e9c618e93 | [
"BSD-3-Clause"
] | null | null | null | import asyncio
import random
import toga
from toga.constants import ROW, COLUMN
from toga.style import Pack
from .bot import Eliza
class BeelizaApp(toga.App):
async def handle_input(self, widget, **kwargs):
# Display the input as a chat entry.
input_text = self.text_input.value
self.chat... | 27.477778 | 92 | 0.561262 | import asyncio
import random
import toga
from toga.constants import ROW, COLUMN
from toga.style import Pack
from .bot import Eliza
class BeelizaApp(toga.App):
async def handle_input(self, widget, **kwargs):
input_text = self.text_input.value
self.chat.data.append(
... | true | true |
f77c10cd3d8b39b170f6b85954e664c4941d93af | 11,033 | py | Python | tabular/tests/unittests/data/test_label_cleaner.py | zhiqiangdon/autogluon | 71ee7ef0f05d8f0aad112d8c1719174aa33194d9 | [
"Apache-2.0"
] | 4,462 | 2019-12-09T17:41:07.000Z | 2022-03-31T22:00:41.000Z | tabular/tests/unittests/data/test_label_cleaner.py | zhiqiangdon/autogluon | 71ee7ef0f05d8f0aad112d8c1719174aa33194d9 | [
"Apache-2.0"
] | 1,408 | 2019-12-09T17:48:59.000Z | 2022-03-31T20:24:12.000Z | tabular/tests/unittests/data/test_label_cleaner.py | zhiqiangdon/autogluon | 71ee7ef0f05d8f0aad112d8c1719174aa33194d9 | [
"Apache-2.0"
] | 623 | 2019-12-10T02:04:18.000Z | 2022-03-20T17:11:01.000Z | import numpy as np
import pandas as pd
import pytest
from autogluon.core.constants import BINARY, MULTICLASS, REGRESSION, SOFTCLASS
from autogluon.core.data.label_cleaner import LabelCleaner, LabelCleanerBinary, LabelCleanerMulticlass, LabelCleanerMulticlassToBinary, LabelCleanerDummy
def test_label_cleaner_binary()... | 49.698198 | 153 | 0.7909 | import numpy as np
import pandas as pd
import pytest
from autogluon.core.constants import BINARY, MULTICLASS, REGRESSION, SOFTCLASS
from autogluon.core.data.label_cleaner import LabelCleaner, LabelCleanerBinary, LabelCleanerMulticlass, LabelCleanerMulticlassToBinary, LabelCleanerDummy
def test_label_cleaner_binary()... | true | true |
f77c10cefdb3af78e5f9880f5b41d92618e2a35c | 1,465 | py | Python | poll_from_google.py | killgill/SPDD | 93af015dc2ee60836d1d76d70b0a038b11052de9 | [
"MIT"
] | null | null | null | poll_from_google.py | killgill/SPDD | 93af015dc2ee60836d1d76d70b0a038b11052de9 | [
"MIT"
] | 1 | 2018-11-14T19:43:04.000Z | 2018-11-14T19:43:04.000Z | poll_from_google.py | killgill/SPDD | 93af015dc2ee60836d1d76d70b0a038b11052de9 | [
"MIT"
] | null | null | null | from googleapiclient.discovery import build
from httplib2 import Http
from oauth2client import file, client, tools
import pickle
from audio_system import *
class PollGoogle():
def __init__(self):
#sets up spreadsheet connection
self.SCOPES = 'https://www.googleapis.com/auth/spreadsheets'
s... | 34.880952 | 127 | 0.658703 | from googleapiclient.discovery import build
from httplib2 import Http
from oauth2client import file, client, tools
import pickle
from audio_system import *
class PollGoogle():
def __init__(self):
self.SCOPES = 'https://www.googleapis.com/auth/spreadsheets'
self.store = file.Storage('token.... | true | true |
f77c125b0a25ea4d37621e8588ff10bde99f7b6e | 4,356 | py | Python | problems/83.py | mengshun/Leetcode | 8bb676f2fff093e1417a4bed13d9ad708149be78 | [
"MIT"
] | null | null | null | problems/83.py | mengshun/Leetcode | 8bb676f2fff093e1417a4bed13d9ad708149be78 | [
"MIT"
] | null | null | null | problems/83.py | mengshun/Leetcode | 8bb676f2fff093e1417a4bed13d9ad708149be78 | [
"MIT"
] | null | null | null | """
83 删除排序链表中的重复元素
"""
from TreeNode import ListNode
print("83. 删除排序链表中的重复元素")
def deleteDuplicatesOne(head):
dp = []
last = ListNode(0)
pre = head
while pre:
if pre.val not in dp:
dp.append(pre.val)
last.next = pre
last = pre
pre = pre.next
l... | 22.806283 | 71 | 0.584711 | from TreeNode import ListNode
print("83. 删除排序链表中的重复元素")
def deleteDuplicatesOne(head):
dp = []
last = ListNode(0)
pre = head
while pre:
if pre.val not in dp:
dp.append(pre.val)
last.next = pre
last = pre
pre = pre.next
last.next = None
retu... | true | true |
f77c12b87fc710dd1867467911baa9bd07b7efaa | 6,497 | py | Python | openmdao.lib/src/openmdao/lib/drivers/test/test_sensitivity.py | mjfwest/OpenMDAO-Framework | a5521f47ad7686c25b203de74e1c7dff5fd7a52b | [
"Apache-2.0"
] | 69 | 2015-01-02T19:10:08.000Z | 2021-11-14T04:42:28.000Z | openmdao.lib/src/openmdao/lib/drivers/test/test_sensitivity.py | jcchin/OpenMDAO-Framework | 038e89b06da1c74f00918f4c6fbd8bd365e25657 | [
"Apache-2.0"
] | 3 | 2015-01-15T23:08:18.000Z | 2015-03-11T16:57:35.000Z | openmdao.lib/src/openmdao/lib/drivers/test/test_sensitivity.py | jcchin/OpenMDAO-Framework | 038e89b06da1c74f00918f4c6fbd8bd365e25657 | [
"Apache-2.0"
] | 31 | 2015-09-16T00:37:35.000Z | 2022-01-10T06:27:55.000Z | """
Test the SensitivityDriver component
"""
import unittest
# pylint: disable-msg=F0401,E0611
from openmdao.main.datatypes.api import Array, Float
from openmdao.lib.drivers.sensitivity import SensitivityDriver
from openmdao.main.interfaces import IHasParameters, implements
from openmdao.main.hasparameters import Has... | 32.485 | 72 | 0.581037 | """
Test the SensitivityDriver component
"""
import unittest
from openmdao.main.datatypes.api import Array, Float
from openmdao.lib.drivers.sensitivity import SensitivityDriver
from openmdao.main.interfaces import IHasParameters, implements
from openmdao.main.hasparameters import HasParameters
from openmdao.util.deco... | false | true |
f77c1313a34bee58513d4f8ce3d021f08f7f136d | 6,147 | py | Python | xnas/search_space/NASBench1shot1/cnn.py | MAC-AutoML/XNAS | 2c54ceb09b255cbcabd67f3c39fc777c4b2403f4 | [
"MIT"
] | 9 | 2021-04-21T08:14:03.000Z | 2021-11-26T11:52:40.000Z | xnas/search_space/NASBench1shot1/cnn.py | MAC-AutoML/XNAS | 2c54ceb09b255cbcabd67f3c39fc777c4b2403f4 | [
"MIT"
] | null | null | null | xnas/search_space/NASBench1shot1/cnn.py | MAC-AutoML/XNAS | 2c54ceb09b255cbcabd67f3c39fc777c4b2403f4 | [
"MIT"
] | 6 | 2021-05-19T02:36:43.000Z | 2021-12-03T07:21:37.000Z | from xnas.search_space.NASBench1shot1.ops import *
from xnas.core.utils import index_to_one_hot, one_hot_to_index
class NASBench1shot1Cell(nn.Module):
def __init__(self, steps, C_prev, C, layer, search_space):
super(NASBench1shot1Cell, self).__init__()
self._steps = steps
self._choice_bl... | 40.176471 | 120 | 0.619652 | from xnas.search_space.NASBench1shot1.ops import *
from xnas.core.utils import index_to_one_hot, one_hot_to_index
class NASBench1shot1Cell(nn.Module):
def __init__(self, steps, C_prev, C, layer, search_space):
super(NASBench1shot1Cell, self).__init__()
self._steps = steps
self._choice_bl... | true | true |
f77c14ec641f29ee40b8abd23b6f29205482d260 | 6,069 | py | Python | tests/unit/anchore_engine/util/test_maven.py | dspalmer99/anchore-engine | 8c61318be6fec5d767426fa4ccd98472cc85b5cd | [
"Apache-2.0"
] | 1 | 2019-06-27T08:47:48.000Z | 2019-06-27T08:47:48.000Z | tests/unit/anchore_engine/util/test_maven.py | dspalmer99/anchore-engine | 8c61318be6fec5d767426fa4ccd98472cc85b5cd | [
"Apache-2.0"
] | 4 | 2020-11-07T00:16:02.000Z | 2020-11-08T20:52:06.000Z | tests/unit/anchore_engine/util/test_maven.py | dspalmer99/anchore-engine | 8c61318be6fec5d767426fa4ccd98472cc85b5cd | [
"Apache-2.0"
] | 1 | 2019-11-23T03:39:28.000Z | 2019-11-23T03:39:28.000Z | import unittest
from anchore_engine.util.maven import MavenVersion
class TestMavenVersionHandling(unittest.TestCase):
_versions_qualifier_ = ['1-alpha2snapshot', '1-alpha2', '1-alpha-123', '1-beta-2', '1-beta123', '1-m2', '1-m11',
'1-rc', '1-cr2', '1-rc123', '1-SNAPSHOT', '1', '1-sp',... | 50.157025 | 120 | 0.538309 | import unittest
from anchore_engine.util.maven import MavenVersion
class TestMavenVersionHandling(unittest.TestCase):
_versions_qualifier_ = ['1-alpha2snapshot', '1-alpha2', '1-alpha-123', '1-beta-2', '1-beta123', '1-m2', '1-m11',
'1-rc', '1-cr2', '1-rc123', '1-SNAPSHOT', '1', '1-sp',... | true | true |
f77c155d2980c3522491e8e230d184c94c2c55e2 | 799 | py | Python | mysite/mysite/urls.py | cs-fullstack-2019-spring/django-intro1-cw-rdunavant | 343eaa6e3ef5ab6c57bf3013d7249d5df74e3db0 | [
"Apache-2.0"
] | null | null | null | mysite/mysite/urls.py | cs-fullstack-2019-spring/django-intro1-cw-rdunavant | 343eaa6e3ef5ab6c57bf3013d7249d5df74e3db0 | [
"Apache-2.0"
] | null | null | null | mysite/mysite/urls.py | cs-fullstack-2019-spring/django-intro1-cw-rdunavant | 343eaa6e3ef5ab6c57bf3013d7249d5df74e3db0 | [
"Apache-2.0"
] | null | null | null | """mysite URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based ... | 36.318182 | 77 | 0.703379 | from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path('polls/', include('polls.urls')),
path('admin/', admin.site.urls),
] | true | true |
f77c165ac89fa27f1aa0b65aa0d38bbd8a08681d | 753 | py | Python | Class Work/Hash Tables/HashTable.py | Pondorasti/CS-1.2 | c86efa40f8a09c1ca1ce0b937ca63a07108bfc6c | [
"MIT"
] | null | null | null | Class Work/Hash Tables/HashTable.py | Pondorasti/CS-1.2 | c86efa40f8a09c1ca1ce0b937ca63a07108bfc6c | [
"MIT"
] | null | null | null | Class Work/Hash Tables/HashTable.py | Pondorasti/CS-1.2 | c86efa40f8a09c1ca1ce0b937ca63a07108bfc6c | [
"MIT"
] | null | null | null | from LinkedList import LinkedList
class HashTable:
def __init__(self):
self.__length = 16
self.__buckets = []
for _ in range(self.__length):
self.__buckets.append(LinkedList())
def _get_bucket(self, key):
return hash(key) % self.__length
def insert(self, item):
bucket_key = self._get... | 20.916667 | 42 | 0.665339 | from LinkedList import LinkedList
class HashTable:
def __init__(self):
self.__length = 16
self.__buckets = []
for _ in range(self.__length):
self.__buckets.append(LinkedList())
def _get_bucket(self, key):
return hash(key) % self.__length
def insert(self, item):
bucket_key = self._get... | true | true |
f77c16a956883f0a86016b7f824d219480e8cedf | 6,829 | py | Python | src/genie/libs/parser/nxos/show_ntp.py | Drey/genieparser | f16649efabf1f3c892bcaad340ae24ce5403ba6b | [
"Apache-2.0"
] | null | null | null | src/genie/libs/parser/nxos/show_ntp.py | Drey/genieparser | f16649efabf1f3c892bcaad340ae24ce5403ba6b | [
"Apache-2.0"
] | null | null | null | src/genie/libs/parser/nxos/show_ntp.py | Drey/genieparser | f16649efabf1f3c892bcaad340ae24ce5403ba6b | [
"Apache-2.0"
] | null | null | null | """show_ntp.py
NXOS parsers for the following show commands:
* show ntp peer-status
* show ntp peers
"""
# Python
import re
# Metaparser
from genie.metaparser import MetaParser
from genie.metaparser.util.schemaengine import Schema, Any, Optional
# import parser utils
from genie.libs.parser.utils.common im... | 34.145 | 130 | 0.427442 |
import re
from genie.metaparser import MetaParser
from genie.metaparser.util.schemaengine import Schema, Any, Optional
from genie.libs.parser.utils.common import Common
class ShowNtpPeerStatusSchema(MetaParser):
schema = {
'total_peers': int,
'vrf': {
Any():{
'peer'... | true | true |
f77c1817f4668b65796a16e6aa37a6974c078bca | 728 | py | Python | social/parser.py | RegadorAutomaticoConsciente/RACAP | 2d097eb4671eeef311169ce3cb1ab77226f37b4d | [
"Apache-2.0"
] | null | null | null | social/parser.py | RegadorAutomaticoConsciente/RACAP | 2d097eb4671eeef311169ce3cb1ab77226f37b4d | [
"Apache-2.0"
] | 4 | 2019-11-05T19:36:30.000Z | 2019-11-19T19:48:08.000Z | social/parser.py | RegadorAutomaticoConsciente/RACAP | 2d097eb4671eeef311169ce3cb1ab77226f37b4d | [
"Apache-2.0"
] | null | null | null | from controller import get_logger
START = "startMessage"
class Parser:
logger = get_logger("Parser")
def __init__(self):
self._data = None
def parse(self, data):
self.logger.debug("Parsing data: \"%s\"", data)
if data.startswith(START):
self._data = data
... | 22.060606 | 67 | 0.502747 | from controller import get_logger
START = "startMessage"
class Parser:
logger = get_logger("Parser")
def __init__(self):
self._data = None
def parse(self, data):
self.logger.debug("Parsing data: \"%s\"", data)
if data.startswith(START):
self._data = data
... | true | true |
f77c1828190e749ebc4fc57faff140c9b576abc8 | 18,609 | py | Python | lopd/views.py | jjmartinr01/gauss3 | 1c71c44430e0f15fb2f3f83d32ad66bb1b7e3e94 | [
"MIT"
] | null | null | null | lopd/views.py | jjmartinr01/gauss3 | 1c71c44430e0f15fb2f3f83d32ad66bb1b7e3e94 | [
"MIT"
] | null | null | null | lopd/views.py | jjmartinr01/gauss3 | 1c71c44430e0f15fb2f3f83d32ad66bb1b7e3e94 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import datetime
from django.contrib.auth.decorators import login_required
from django.forms import ModelForm
from django.http import HttpResponse
from django.shortcuts import render
from django.template import RequestContext
from django.template.loader import render_to_string
from autenticar.co... | 54.09593 | 140 | 0.534365 | import datetime
from django.contrib.auth.decorators import login_required
from django.forms import ModelForm
from django.http import HttpResponse
from django.shortcuts import render
from django.template import RequestContext
from django.template.loader import render_to_string
from autenticar.control_acceso import perm... | true | true |
f77c18fa77dee8b14ddac493c37305ef0143d51c | 6,920 | py | Python | scripts/parse_live.py | jhsoby/citationhunt | e9e19387d0aff6dbf6526a35a33adf008e53b3fd | [
"MIT"
] | null | null | null | scripts/parse_live.py | jhsoby/citationhunt | e9e19387d0aff6dbf6526a35a33adf008e53b3fd | [
"MIT"
] | null | null | null | scripts/parse_live.py | jhsoby/citationhunt | e9e19387d0aff6dbf6526a35a33adf008e53b3fd | [
"MIT"
] | null | null | null | #!/usr/bin/env python
'''
Parser for articles retrieved from the Wikipedia API for CitationHunt.
Given a file with one pageid per line, this script will find unsourced
snippets in the pages in the pageid file. It will store the pages containing
valid snippets in the `articles` database table, and the snippets in the
... | 30.619469 | 116 | 0.648266 |
from __future__ import unicode_literals
import os
import sys
_upper_dir = os.path.abspath(
os.path.join(os.path.dirname(__file__), '..'))
if _upper_dir not in sys.path:
sys.path.append(_upper_dir)
import chdb
import config
import snippet_parser
import multiprocessing
from utils import *
import docopt
impor... | true | true |
f77c199e65c819e013bea67ba2e5821636e3b421 | 983 | py | Python | exercicios/ex087.py | DeyvisonR/curso_python | 983b634d39f542369628ae48c7449ea75fd1ebbd | [
"MIT"
] | null | null | null | exercicios/ex087.py | DeyvisonR/curso_python | 983b634d39f542369628ae48c7449ea75fd1ebbd | [
"MIT"
] | null | null | null | exercicios/ex087.py | DeyvisonR/curso_python | 983b634d39f542369628ae48c7449ea75fd1ebbd | [
"MIT"
] | null | null | null | matriz = [[0, 0, 0], [0, 0, 0], [0, 0, 0]]
somap = cont = somat = 0
for l in range(0, 3):
for c in range(0, 3):
n = ' '
while n.isnumeric() == False:
n = input(f'digite um valor para [{l}, {c}]: ')
if n.isnumeric() == False:
print('o valor digitado não e um nú... | 32.766667 | 68 | 0.462869 | matriz = [[0, 0, 0], [0, 0, 0], [0, 0, 0]]
somap = cont = somat = 0
for l in range(0, 3):
for c in range(0, 3):
n = ' '
while n.isnumeric() == False:
n = input(f'digite um valor para [{l}, {c}]: ')
if n.isnumeric() == False:
print('o valor digitado não e um nú... | true | true |
f77c1a3e848c0f78889c113c9c425ce4fdd37434 | 2,736 | py | Python | migrations/versions/0314_no_reply_template.py | davidbgk/notification-api | 0ede6a61b48289236d1873124965d2bc22a9b27b | [
"MIT"
] | null | null | null | migrations/versions/0314_no_reply_template.py | davidbgk/notification-api | 0ede6a61b48289236d1873124965d2bc22a9b27b | [
"MIT"
] | null | null | null | migrations/versions/0314_no_reply_template.py | davidbgk/notification-api | 0ede6a61b48289236d1873124965d2bc22a9b27b | [
"MIT"
] | null | null | null | """
Revision ID: 0314_no_reply_template
Revises: 0313_disable_pinpoint_provider
Create Date: 2021-02-09 13:37:42
"""
from alembic import op
from flask import current_app
revision = '0314_no_reply_template'
down_revision = '0313_disable_pinpoint_provider'
templates = [
{
'id': current_app.config['NO_RE... | 34.2 | 149 | 0.553363 | from alembic import op
from flask import current_app
revision = '0314_no_reply_template'
down_revision = '0313_disable_pinpoint_provider'
templates = [
{
'id': current_app.config['NO_REPLY_TEMPLATE_ID'],
'name': 'No Reply',
'type': 'email',
'subject': 'Message not delivered | Mes... | true | true |
f77c1b6fe6b3dcdaabbfc9234ab8bd050bc02967 | 828 | py | Python | stack/0844_backspace_string_compare/0844_backspace_string_compare.py | zdyxry/LeetCode | 33371285d0f3302158230f46e8b1b63b9f4639c4 | [
"Xnet",
"X11"
] | 6 | 2019-09-16T01:50:44.000Z | 2020-09-17T08:52:25.000Z | stack/0844_backspace_string_compare/0844_backspace_string_compare.py | zdyxry/LeetCode | 33371285d0f3302158230f46e8b1b63b9f4639c4 | [
"Xnet",
"X11"
] | null | null | null | stack/0844_backspace_string_compare/0844_backspace_string_compare.py | zdyxry/LeetCode | 33371285d0f3302158230f46e8b1b63b9f4639c4 | [
"Xnet",
"X11"
] | 4 | 2020-02-07T12:43:16.000Z | 2021-04-11T06:38:55.000Z | class Solution(object):
def backspaceCompare(self, S1, S2):
r1 = len(S1) - 1
r2 = len (S2) - 1
while r1 >= 0 or r2 >= 0:
char1 = char2 = ""
if r1 >= 0:
char1, r1 = self.getChar(S1, r1)
if r2 >= 0:
char2, r2 = self.... | 25.090909 | 48 | 0.390097 | class Solution(object):
def backspaceCompare(self, S1, S2):
r1 = len(S1) - 1
r2 = len (S2) - 1
while r1 >= 0 or r2 >= 0:
char1 = char2 = ""
if r1 >= 0:
char1, r1 = self.getChar(S1, r1)
if r2 >= 0:
char2, r2 = self.... | true | true |
f77c1b75636e124b331311d958a0386cb5dc718c | 1,804 | py | Python | actin/actin_files/ac_settings.py | j-faria/ACTIN | f16d597472ccabb7627753179032e18ae21e83a2 | [
"MIT"
] | null | null | null | actin/actin_files/ac_settings.py | j-faria/ACTIN | f16d597472ccabb7627753179032e18ae21e83a2 | [
"MIT"
] | null | null | null | actin/actin_files/ac_settings.py | j-faria/ACTIN | f16d597472ccabb7627753179032e18ae21e83a2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# compatibility with python 2/3:
from __future__ import print_function
from __future__ import division
import numpy as np
def init():
# Accepted file types
global ftypes
ftypes = {}
ftypes['1d'] = ['S1D',
's1d',
'ADP',
... | 25.055556 | 202 | 0.549335 |
from __future__ import print_function
from __future__ import division
import numpy as np
def init():
global ftypes
ftypes = {}
ftypes['1d'] = ['S1D',
's1d',
'ADP',
'rdb']
ftypes['2d'] = ['S2D',
'e2ds']
ftypes[... | true | true |
f77c1b93b2c5a92321faae6b9ce4238af8def387 | 1,708 | py | Python | 10-regression.py | koushalkh/ML-LAB | 5022ac2855d673bf21202b3c260d2ab0aa123bb6 | [
"MIT"
] | 12 | 2018-10-11T10:18:26.000Z | 2019-01-23T18:09:34.000Z | 10-regression.py | MadanKrishnan97/ML-LAB | 597389b7c93f964361baad8c8e27b2cf196e967c | [
"MIT"
] | 2 | 2018-11-26T10:46:22.000Z | 2018-11-26T13:31:21.000Z | 10-regression.py | MadanKrishnan97/ML-LAB | 597389b7c93f964361baad8c8e27b2cf196e967c | [
"MIT"
] | 9 | 2018-11-22T13:58:42.000Z | 2019-10-23T11:06:53.000Z | import numpy as np
from bokeh.plotting import figure, show, output_notebook
from bokeh.layouts import gridplot
from bokeh.io import push_notebook
#output_notebook()
import numpy as np
def local_regression(x0, X, Y, tau):
# add bias term
x0 = np.r_[1, x0] # Add one to avoid the loss in information
... | 33.490196 | 110 | 0.62822 | import numpy as np
from bokeh.plotting import figure, show, output_notebook
from bokeh.layouts import gridplot
from bokeh.io import push_notebook
import numpy as np
def local_regression(x0, X, Y, tau):
x0 = np.r_[1, x0] X = np.c_[np.ones(len(X)), X]
xw = X.T * radial_kernel(x0... | true | true |
f77c1c6669dedaf6d8ed9a19e6655fc7af18b5db | 11,628 | py | Python | onmt/model_builder.py | miyamotost/ITDD-with-DialogueAct | 827b8b27bacb8a48fea479e709c39eaee3610552 | [
"MIT"
] | null | null | null | onmt/model_builder.py | miyamotost/ITDD-with-DialogueAct | 827b8b27bacb8a48fea479e709c39eaee3610552 | [
"MIT"
] | null | null | null | onmt/model_builder.py | miyamotost/ITDD-with-DialogueAct | 827b8b27bacb8a48fea479e709c39eaee3610552 | [
"MIT"
] | null | null | null | """
This file is for models creation, which consults options
and creates each encoder and decoder accordingly.
"""
import re
import torch
import torch.nn as nn
from torch.nn.init import xavier_uniform_
import onmt.inputters as inputters
import onmt.modules
from onmt.encoders.rnn_encoder import RNNEncoder
from onmt.enc... | 35.343465 | 119 | 0.635621 | import re
import torch
import torch.nn as nn
from torch.nn.init import xavier_uniform_
import onmt.inputters as inputters
import onmt.modules
from onmt.encoders.rnn_encoder import RNNEncoder
from onmt.encoders.mtransformer import TransformerEncoder
from onmt.encoders.cnn_encoder import CNNEncoder
from onmt.encoders.me... | true | true |
f77c1d342ca1e9457cf40ac11762568d29848866 | 310 | py | Python | problems/141.Linked_List_Cycle/solution.py | subramp-prep/leetcode | d125201d9021ab9b1eea5e5393c2db4edd84e740 | [
"Unlicense"
] | null | null | null | problems/141.Linked_List_Cycle/solution.py | subramp-prep/leetcode | d125201d9021ab9b1eea5e5393c2db4edd84e740 | [
"Unlicense"
] | null | null | null | problems/141.Linked_List_Cycle/solution.py | subramp-prep/leetcode | d125201d9021ab9b1eea5e5393c2db4edd84e740 | [
"Unlicense"
] | null | null | null | def hasCycle(self, head):
fast = slow = head
while slow and fast and fast.next:
slow = slow.next # Step of 1
fast = fast.next.next # Setp of 2
if slow is fast: # Checking whether two pointers meet
return True
return False
| 34.444444 | 76 | 0.525806 | def hasCycle(self, head):
fast = slow = head
while slow and fast and fast.next:
slow = slow.next fast = fast.next.next if slow is fast: return True
return False
| true | true |
f77c1e9b086c6492c8b5ea43b220cb20ac1567a6 | 90 | py | Python | Decorator/decorator.py | JohnnyUtah-9/calculatorclassproject | 4e24532d16549d9d2d2198331e9a283f48313b80 | [
"MIT"
] | null | null | null | Decorator/decorator.py | JohnnyUtah-9/calculatorclassproject | 4e24532d16549d9d2d2198331e9a283f48313b80 | [
"MIT"
] | null | null | null | Decorator/decorator.py | JohnnyUtah-9/calculatorclassproject | 4e24532d16549d9d2d2198331e9a283f48313b80 | [
"MIT"
] | 1 | 2021-02-28T22:22:08.000Z | 2021-02-28T22:22:08.000Z | def do_twice(func):
def wrapper_do_twice():
func()
func()
return
| 12.857143 | 27 | 0.533333 | def do_twice(func):
def wrapper_do_twice():
func()
func()
return
| true | true |
f77c201521612b534eedaba7d56349a25f2977b3 | 319 | py | Python | desafio026.py | EdnaMota/python3_estudos | 78fd4cf0063329d02b1e8b6f0094679e8922d5d7 | [
"MIT"
] | null | null | null | desafio026.py | EdnaMota/python3_estudos | 78fd4cf0063329d02b1e8b6f0094679e8922d5d7 | [
"MIT"
] | null | null | null | desafio026.py | EdnaMota/python3_estudos | 78fd4cf0063329d02b1e8b6f0094679e8922d5d7 | [
"MIT"
] | null | null | null | frase = str(input('Digite uma frase: ')).upper().strip()
print(f'A letra "A" aparece {frase.count("A")} vezes na frase.')
print(f'A primeira letra A apareceu na posição {frase.find("A")+1}.')
print(f'A última letra A apareceu na posição {frase.rfind("A")+1}.')
## .join(frase.split()) juntar tudo, remover espaços | 53.166667 | 70 | 0.673981 | frase = str(input('Digite uma frase: ')).upper().strip()
print(f'A letra "A" aparece {frase.count("A")} vezes na frase.')
print(f'A primeira letra A apareceu na posição {frase.find("A")+1}.')
print(f'A última letra A apareceu na posição {frase.rfind("A")+1}.')
| true | true |
f77c20eacf898c930595e96b6deb34ade124d304 | 483 | py | Python | lib/bes/fs/find/max_depth_criteria.py | reconstruir/bes | 82ff54b2dadcaef6849d7de424787f1dedace85c | [
"Apache-2.0"
] | null | null | null | lib/bes/fs/find/max_depth_criteria.py | reconstruir/bes | 82ff54b2dadcaef6849d7de424787f1dedace85c | [
"Apache-2.0"
] | null | null | null | lib/bes/fs/find/max_depth_criteria.py | reconstruir/bes | 82ff54b2dadcaef6849d7de424787f1dedace85c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#-*- coding:utf-8; mode:python; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*-
from .criteria import criteria
class max_depth_criteria(criteria):
'make sure the file path depth is less than or equal to a max depth.'
def __init__(self, max_depth):
super(max_depth_criteria, se... | 32.2 | 90 | 0.718427 |
from .criteria import criteria
class max_depth_criteria(criteria):
def __init__(self, max_depth):
super(max_depth_criteria, self).__init__(action = self.STOP, target = self.DIR)
self.max_depth = max_depth
def matches(self, variables):
return variables.depth <= self.max_depth
| true | true |
f77c214331b52935716d70af1bc151a6a950f0cc | 1,348 | py | Python | center/app/thirdparty/plugins/vendor/__init__.py | netSensTeam/netSens | 7ab5f41a7103e6c86aa6cb2eff3df68c301e48c1 | [
"MIT"
] | null | null | null | center/app/thirdparty/plugins/vendor/__init__.py | netSensTeam/netSens | 7ab5f41a7103e6c86aa6cb2eff3df68c301e48c1 | [
"MIT"
] | 3 | 2021-05-10T13:50:55.000Z | 2022-03-02T08:12:46.000Z | center/app/thirdparty/plugins/vendor/__init__.py | netSensTeam/netSens | 7ab5f41a7103e6c86aa6cb2eff3df68c301e48c1 | [
"MIT"
] | null | null | null | import json
logger = None
name = 'Vendor'
uuid = 'vendor-123'
level = 'device'
vendor_file = 'plugins/vendor/mac_vendor'
with open(vendor_file, 'r', encoding="utf-8") as fp:
vendor_data = fp.readlines()
vendors = {}
for vnd in vendor_data:
vnd_parts = vnd.split('\t')
vendors[vnd_parts[0].strip()] = vnd_pa... | 23.649123 | 56 | 0.612018 | import json
logger = None
name = 'Vendor'
uuid = 'vendor-123'
level = 'device'
vendor_file = 'plugins/vendor/mac_vendor'
with open(vendor_file, 'r', encoding="utf-8") as fp:
vendor_data = fp.readlines()
vendors = {}
for vnd in vendor_data:
vnd_parts = vnd.split('\t')
vendors[vnd_parts[0].strip()] = vnd_pa... | true | true |
f77c21ec81128a4e62475106c19b0f55e8e6eb09 | 635 | py | Python | 6-python-mysql/f08-mysql-drop-table02.py | luis2ra/py3-00-w3schools | 6bb851837f8ef9520491d13fa2c909047c9b18cf | [
"MIT"
] | null | null | null | 6-python-mysql/f08-mysql-drop-table02.py | luis2ra/py3-00-w3schools | 6bb851837f8ef9520491d13fa2c909047c9b18cf | [
"MIT"
] | null | null | null | 6-python-mysql/f08-mysql-drop-table02.py | luis2ra/py3-00-w3schools | 6bb851837f8ef9520491d13fa2c909047c9b18cf | [
"MIT"
] | null | null | null | '''
Python MySQL Drop Table
Delete a Table
You can delete an existing table by using the "DROP TABLE" statement.
Drop Only if Exist
If the the table you want to delete is already deleted, or for any other reason does not exist, you can use the IF EXISTS keyword to avoid getting an error.
'''
import mysql.connect... | 21.166667 | 156 | 0.733858 | import mysql.connector
mydb = mysql.connector.connect(
host="localhost",
user="userdemo",
password="123",
database="mydatabase1"
)
mycursor = mydb.cursor()
sql = "DROP TABLE IF EXISTS customers"
mycursor.execute(sql)
| true | true |
f77c22a04a0898dbe60adcb282357e942c65d46d | 6,820 | py | Python | edabit.py | valeriybercha/py-test-exercises | 6cc11840d993ce1d50cd77610f3e831ebf25b1de | [
"MIT"
] | null | null | null | edabit.py | valeriybercha/py-test-exercises | 6cc11840d993ce1d50cd77610f3e831ebf25b1de | [
"MIT"
] | null | null | null | edabit.py | valeriybercha/py-test-exercises | 6cc11840d993ce1d50cd77610f3e831ebf25b1de | [
"MIT"
] | null | null | null | # Coding challenges solutions on Edabit platform
# TASK - How Edabit Works
def hello():
return "hello edabit.com"
# TASK - Return the Sum of Two Numbers
# Create a function that takes two numbers as arguments and return their sum.
def addition(num1, num2):
return num1 + num2
# TASK - Return the Next Numbe... | 25.35316 | 133 | 0.653519 |
def hello():
return "hello edabit.com"
def addition(num1, num2):
return num1 + num2
def addition(num):
return num + 1
def cubes(a):
return a ** 3
def find_perimeter(l, w):
return 2 * (l + w)
def convert(min):
return min * 60
def tri_area(base, height):
return (base * hei... | true | true |
f77c2309791bec0f6a0841ecc205e0707b15d4e2 | 3,785 | py | Python | builder_tasks/CAS_2_incorporate_reference.py | gwallison/openFF-build | 3526dd5fdb78576186399f84c0bcb95b7edfd991 | [
"MIT"
] | null | null | null | builder_tasks/CAS_2_incorporate_reference.py | gwallison/openFF-build | 3526dd5fdb78576186399f84c0bcb95b7edfd991 | [
"MIT"
] | 8 | 2021-11-30T19:35:13.000Z | 2021-12-20T15:25:19.000Z | builder_tasks/CAS_2_incorporate_reference.py | gwallison/openFF-build | 3526dd5fdb78576186399f84c0bcb95b7edfd991 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Wed Mar 31 07:32:13 2021
@author: Gary
In this script, the cas master list is merged with the CAS reference list
created from the SciFinder searches.
The steps in this process:
- fetch the reference dataframes for authoritative CAS numbers and deprecated ones.
- find and mark... | 44.011628 | 88 | 0.614003 | import numpy as np
import pandas as pd
import sys
def merge_with_ref(df):
ref = pd.read_csv('./sources/CAS_ref_and_names.csv',
encoding='utf-8',quotechar='$')
dep = pd.read_csv('./sources/CAS_deprecated.csv',encoding='utf-8',quotechar='$')
test = pd.merge(df, ... | true | true |
f77c23691fda1125806050f70efac65b2b3917c6 | 383 | py | Python | hail/python/hailtop/utils/validate/__init__.py | saponas/hail | bafea6b18247a4279d6ef11015e8e9f3c2b5ecea | [
"MIT"
] | null | null | null | hail/python/hailtop/utils/validate/__init__.py | saponas/hail | bafea6b18247a4279d6ef11015e8e9f3c2b5ecea | [
"MIT"
] | null | null | null | hail/python/hailtop/utils/validate/__init__.py | saponas/hail | bafea6b18247a4279d6ef11015e8e9f3c2b5ecea | [
"MIT"
] | null | null | null | from .validate import anyof, bool_type, dictof, keyed, listof, int_type, nullable, \
numeric, oneof, regex, required, str_type, switch, ValidationError
__all__ = [
'anyof',
'bool_type',
'dictof',
'keyed',
'listof',
'int_type',
'nullable',
'numeric',
'oneof',
'regex',
're... | 19.15 | 84 | 0.592689 | from .validate import anyof, bool_type, dictof, keyed, listof, int_type, nullable, \
numeric, oneof, regex, required, str_type, switch, ValidationError
__all__ = [
'anyof',
'bool_type',
'dictof',
'keyed',
'listof',
'int_type',
'nullable',
'numeric',
'oneof',
'regex',
're... | true | true |
f77c256580eaad26844b1c0b7a21782351cda5b0 | 41,096 | py | Python | testplan/common/entity/base.py | tjisanaMS/testplan | 7c9a3604ef05458948fc3c393790358d467b133b | [
"Apache-2.0"
] | 96 | 2018-03-14T13:14:50.000Z | 2021-01-14T08:26:08.000Z | testplan/common/entity/base.py | tjisanaMS/testplan | 7c9a3604ef05458948fc3c393790358d467b133b | [
"Apache-2.0"
] | 135 | 2018-06-28T02:41:05.000Z | 2021-01-19T02:16:58.000Z | testplan/common/entity/base.py | tjisanaMS/testplan | 7c9a3604ef05458948fc3c393790358d467b133b | [
"Apache-2.0"
] | 53 | 2018-03-17T14:39:15.000Z | 2021-01-21T10:54:13.000Z | """
Module containing base classes that represent object entities that can accept
configuration, start/stop/run/abort, create results and have some state.
"""
import os
import sys
import time
import signal
import threading
import traceback
from collections import deque, OrderedDict
import psutil
from schema import Or... | 31.394958 | 83 | 0.590812 |
import os
import sys
import time
import signal
import threading
import traceback
from collections import deque, OrderedDict
import psutil
from schema import Or, And, Use
from testplan.common.config import Config, ConfigOption
from testplan.common.utils.thread import execute_as_thread
from testplan.common.utils.timin... | true | true |
f77c25acb853264e14fc2eb35bbd11abad3fe72e | 28,728 | py | Python | venv/lib/python3.6/site-packages/gevent/_ffi/loop.py | Guillaume-Fernandez/phishfinder | b459a30202fd5dfb1340b43c70363705de7cedd9 | [
"MIT"
] | 10 | 2021-03-23T03:46:19.000Z | 2022-03-08T07:20:25.000Z | venv/lib/python3.6/site-packages/gevent/_ffi/loop.py | Guillaume-Fernandez/phishfinder | b459a30202fd5dfb1340b43c70363705de7cedd9 | [
"MIT"
] | 7 | 2021-05-21T16:51:48.000Z | 2022-03-12T00:50:26.000Z | venv/lib/python3.6/site-packages/gevent/_ffi/loop.py | Guillaume-Fernandez/phishfinder | b459a30202fd5dfb1340b43c70363705de7cedd9 | [
"MIT"
] | 4 | 2021-04-21T00:49:34.000Z | 2021-11-21T09:18:29.000Z | """
Basic loop implementation for ffi-based cores.
"""
# pylint: disable=too-many-lines, protected-access, redefined-outer-name, not-callable
from __future__ import absolute_import, print_function
from collections import deque
import sys
import os
import traceback
from gevent._ffi import _dbg
from gevent._ffi import ... | 40.235294 | 108 | 0.623921 | from __future__ import absolute_import, print_function
from collections import deque
import sys
import os
import traceback
from gevent._ffi import _dbg
from gevent._ffi import GEVENT_DEBUG_LEVEL
from gevent._ffi import TRACE
from gevent._ffi.callback import callback
from gevent._compat import PYPY
from gevent import... | true | true |
f77c25dcffc9cb108012c1c697a3c05637729aca | 1,053 | py | Python | setup.py | passionsfrucht/gitlab-ci-linter | cbbb0e564013e3bd3831080c1ac67577e32df183 | [
"MIT"
] | null | null | null | setup.py | passionsfrucht/gitlab-ci-linter | cbbb0e564013e3bd3831080c1ac67577e32df183 | [
"MIT"
] | null | null | null | setup.py | passionsfrucht/gitlab-ci-linter | cbbb0e564013e3bd3831080c1ac67577e32df183 | [
"MIT"
] | null | null | null | # !/usr/bin/env python
from distutils.core import setup
setup(
name="gitlab-ci-linter",
packages=["gitlab_ci_linter"],
version="1.0.0",
description=".gitlab-ci.yml linter script",
author="Alexey Burov",
license="MIT",
author_email="allburov@gmail.com",
url="https://gitlab.com/devopshq/... | 33.967742 | 82 | 0.617284 |
from distutils.core import setup
setup(
name="gitlab-ci-linter",
packages=["gitlab_ci_linter"],
version="1.0.0",
description=".gitlab-ci.yml linter script",
author="Alexey Burov",
license="MIT",
author_email="allburov@gmail.com",
url="https://gitlab.com/devopshq/check-gitlab-ci",
k... | true | true |
f77c276f9e6c647b595097154d360ab88af7598c | 1,127 | py | Python | app/main.py | thiagopirex/api-finance-lastprice | 0eae168166d94e8c268a42a40769fb234b5c9340 | [
"MIT"
] | null | null | null | app/main.py | thiagopirex/api-finance-lastprice | 0eae168166d94e8c268a42a40769fb234b5c9340 | [
"MIT"
] | null | null | null | app/main.py | thiagopirex/api-finance-lastprice | 0eae168166d94e8c268a42a40769fb234b5c9340 | [
"MIT"
] | null | null | null | from flask import Flask
from flask_restful import Resource, Api
#import para ações
from yahoo_fin import stock_info
#import para opções
from lxml import html
import requests
#
#---------------------------------------------
#
app = Flask(__name__)
api = Api(app)
class Home(Resource):
def get(self):
re... | 28.897436 | 108 | 0.637977 | from flask import Flask
from flask_restful import Resource, Api
from yahoo_fin import stock_info
from lxml import html
import requests
app = Flask(__name__)
api = Api(app)
class Home(Resource):
def get(self):
return "Exemplo de uso da API: http://[ip:port]/acao/PETR4"
class Acao(Resource):
def g... | true | true |
f77c27a55ec9f186176bfc8c90fe393e831b7dca | 6,997 | py | Python | tests/integration/api/v2010/account/queue/test_member.py | scotta/twilio-python | 93cf463f914f55c4c4bd1c259b834953dd81609d | [
"MIT"
] | null | null | null | tests/integration/api/v2010/account/queue/test_member.py | scotta/twilio-python | 93cf463f914f55c4c4bd1c259b834953dd81609d | [
"MIT"
] | null | null | null | tests/integration/api/v2010/account/queue/test_member.py | scotta/twilio-python | 93cf463f914f55c4c4bd1c259b834953dd81609d | [
"MIT"
] | null | null | null | # coding=utf-8
"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from tests import IntegrationTestCase
from tests.holodeck import Request
from twilio.base.exceptions import TwilioException
from twilio.http.response import Response
class MemberTestCase(Integration... | 43.73125 | 182 | 0.58425 |
from tests import IntegrationTestCase
from tests.holodeck import Request
from twilio.base.exceptions import TwilioException
from twilio.http.response import Response
class MemberTestCase(IntegrationTestCase):
def test_fetch_request(self):
self.holodeck.mock(Response(500, ''))
with self.assertRa... | true | true |
f77c28b2b22a967c52685eee3c5fc104a7c25761 | 252 | py | Python | arrays/doublesWithMap.py | ethyl2/code_challenges | 3c9ccca1782f92728e60a515a7ca797f6d470e81 | [
"MIT"
] | null | null | null | arrays/doublesWithMap.py | ethyl2/code_challenges | 3c9ccca1782f92728e60a515a7ca797f6d470e81 | [
"MIT"
] | null | null | null | arrays/doublesWithMap.py | ethyl2/code_challenges | 3c9ccca1782f92728e60a515a7ca797f6d470e81 | [
"MIT"
] | null | null | null | """
https://www.codewars.com/kata/57f781872e3d8ca2a000007e/train/python
Given a list, return a list in which each of the values of the input list is doubled.
Use map()
"""
def maps(a):
return list(map(lambda x: x*2, a))
print(maps([1, 2, 3]))
| 18 | 85 | 0.686508 |
def maps(a):
return list(map(lambda x: x*2, a))
print(maps([1, 2, 3]))
| true | true |
f77c2a480f4dd1ec50ae696c7d043b86b835904b | 20,557 | py | Python | resmanag_system.py | somdev-hub/restaurant_management | 23ef30efb37dd582a15b3919b0a55abafada19c5 | [
"Apache-2.0"
] | null | null | null | resmanag_system.py | somdev-hub/restaurant_management | 23ef30efb37dd582a15b3919b0a55abafada19c5 | [
"Apache-2.0"
] | null | null | null | resmanag_system.py | somdev-hub/restaurant_management | 23ef30efb37dd582a15b3919b0a55abafada19c5 | [
"Apache-2.0"
] | null | null | null | """
Restaurant management System is a genuine project developed by Somdev Behera and Soumya Ranjan Barik for
their academic year computer science project. This project is aimed to be used for the betterment of the targeted
audience. Restaurant management system is developed using python and MySql date bases. This ... | 40.626482 | 121 | 0.592256 |
from tkinter import *
import tkinter.font as font
import datetime as calender
from resmag import resmanag_system_backend as res
from tkinter import messagebox
from tkinter import ttk
from math import *
root = Tk()
root.geometry('1750x700')
root.title('Restaurant management system')
root.config(bg="whe... | true | true |
f77c2aab828f0c71f32f641bb4e2641170a41afc | 3,214 | py | Python | tests/cli/test_show.py | TaoSunVoyage/renku-python | 858fe84ce2925a49d9b62638dc601f581e24353e | [
"Apache-2.0"
] | null | null | null | tests/cli/test_show.py | TaoSunVoyage/renku-python | 858fe84ce2925a49d9b62638dc601f581e24353e | [
"Apache-2.0"
] | null | null | null | tests/cli/test_show.py | TaoSunVoyage/renku-python | 858fe84ce2925a49d9b62638dc601f581e24353e | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright 2019-2021 - Swiss Data Science Center (SDSC)
# A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and
# Eidgenössische Technische Hochschule Zürich (ETHZ).
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in c... | 44.027397 | 101 | 0.673927 |
from renku.cli import cli
from tests.utils import format_result_exception
def test_show_outputs_with_directory(runner, client, run):
base_sh = ["bash", "-c", 'DIR="$0"; mkdir -p "$DIR"; ' 'for x in "$@"; do touch "$DIR/$x"; done']
assert 0 == run(args=["run"] + base_sh + ["output", "foo", "bar"])
assert... | true | true |
f77c2ca9b22cdc890aafa20d1acb4e39e36dec2a | 10,228 | py | Python | Software/GUI/IAQ_GUI.py | justins0923/zephyrus-iaq | 10e5f14f4dc0d1d72a2eff928df4ad572fc99e4c | [
"MIT"
] | 1 | 2019-11-05T18:45:52.000Z | 2019-11-05T18:45:52.000Z | Software/GUI/IAQ_GUI.py | justins0923/zephyrus-iaq | 10e5f14f4dc0d1d72a2eff928df4ad572fc99e4c | [
"MIT"
] | null | null | null | Software/GUI/IAQ_GUI.py | justins0923/zephyrus-iaq | 10e5f14f4dc0d1d72a2eff928df4ad572fc99e4c | [
"MIT"
] | null | null | null | import Tkinter as tk
import ScrolledText as tkst
import time
import csv
from enum import Enum
class GUI(tk.Tk):
MAX_PORTS = 6
AnalogFrames = ["A0", "A1", "A2", "A3","A4", "A5"]
SensorFrames = AnalogFrames + ["SDC30", "SDS011"]
FramesList = SensorFrames
_sensor_update_flag = False
sensorList... | 35.762238 | 117 | 0.539695 | import Tkinter as tk
import ScrolledText as tkst
import time
import csv
from enum import Enum
class GUI(tk.Tk):
MAX_PORTS = 6
AnalogFrames = ["A0", "A1", "A2", "A3","A4", "A5"]
SensorFrames = AnalogFrames + ["SDC30", "SDS011"]
FramesList = SensorFrames
_sensor_update_flag = False
sensorList... | true | true |
f77c2d03aa42064efc089865f9f691a379eeb11f | 1,404 | py | Python | docs/conf.py | Argmaster/PyR3 | 6786bcb6a101fe4bd4cc50fe43767b8178504b15 | [
"MIT"
] | 2 | 2021-12-12T18:51:52.000Z | 2022-02-23T09:49:16.000Z | docs/conf.py | Argmaster/PyR3 | 6786bcb6a101fe4bd4cc50fe43767b8178504b15 | [
"MIT"
] | 2 | 2021-11-08T12:09:02.000Z | 2021-12-12T23:01:12.000Z | docs/conf.py | Argmaster/PyR3 | 6786bcb6a101fe4bd4cc50fe43767b8178504b15 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"sphinx.ext.coverage",
"sphinx.ext.doctest",
"sphinx.ext.extlinks",
"sphinx.ext.ifconfig",
"sphinx.ext.napoleon",
"sphinx.ext.todo",
"sphinx.ext.... | 26.490566 | 67 | 0.684473 | from __future__ import unicode_literals
import os
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"sphinx.ext.coverage",
"sphinx.ext.doctest",
"sphinx.ext.extlinks",
"sphinx.ext.ifconfig",
"sphinx.ext.napoleon",
"sphinx.ext.todo",
"sphinx.ext.viewcode",
"sphinx_r... | true | true |
f77c2ea02a73d920e80c1a66c0333209ff8b9e3f | 2,080 | py | Python | examples/dfp/v201411/report_service/run_sales_report.py | dietrichc/streamline-ppc-reports | 256f79246aba3c2cf8f792d87a066391a2f471e0 | [
"Apache-2.0"
] | 1 | 2015-08-12T14:47:40.000Z | 2015-08-12T14:47:40.000Z | examples/dfp/v201411/report_service/run_sales_report.py | dietrichc/streamline-ppc-reports | 256f79246aba3c2cf8f792d87a066391a2f471e0 | [
"Apache-2.0"
] | 1 | 2020-07-24T15:10:10.000Z | 2020-07-24T15:10:10.000Z | examples/dfp/v201411/report_service/run_sales_report.py | coxmediagroup/googleads-python-lib | f85d5d8ab771e93b03b616ef65e2d3082aeef484 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | 30.588235 | 79 | 0.716827 |
"""This code example runs a report equal to the "Sales by salespersons report."
"""
__author__ = ('Nicholas Chen',
'Joseph DiLallo')
import tempfile
from googleads import dfp
from googleads import errors
def main(client):
report_downloader = client.GetDataDownloader(version='v201411')
report... | false | true |
f77c2f85deb48632b7c65d7496610a308f2f709c | 8,042 | py | Python | akson/kia/models.py | IvanOsyanin/akson_project | 10e4130d85c39fbc116c0d8b6646321cd6f96892 | [
"MIT"
] | null | null | null | akson/kia/models.py | IvanOsyanin/akson_project | 10e4130d85c39fbc116c0d8b6646321cd6f96892 | [
"MIT"
] | null | null | null | akson/kia/models.py | IvanOsyanin/akson_project | 10e4130d85c39fbc116c0d8b6646321cd6f96892 | [
"MIT"
] | null | null | null | import os
import qrcode
from ckeditor.fields import RichTextField
from django.conf import settings
from django.contrib.auth import get_user_model
from django.core.exceptions import ValidationError
from django.db import models
from mptt.models import MPTTModel, TreeForeignKey
from . import constants
User = get_user_m... | 38.295238 | 75 | 0.540164 | import os
import qrcode
from ckeditor.fields import RichTextField
from django.conf import settings
from django.contrib.auth import get_user_model
from django.core.exceptions import ValidationError
from django.db import models
from mptt.models import MPTTModel, TreeForeignKey
from . import constants
User = get_user_m... | true | true |
f77c30f08aca45cb1b6c0629ffd0dba78cf7abd2 | 2,403 | py | Python | lib/utils/funtions.py | PKSingh0017/MSCG-Net | b7e79d68f14984fe460eff72bcbb8049e4d2bc9f | [
"MIT"
] | 59 | 2020-04-23T05:27:22.000Z | 2022-03-04T13:09:01.000Z | lib/utils/funtions.py | PKSingh0017/MSCG-Net | b7e79d68f14984fe460eff72bcbb8049e4d2bc9f | [
"MIT"
] | 11 | 2020-04-29T07:11:58.000Z | 2022-03-12T00:28:29.000Z | lib/utils/funtions.py | PKSingh0017/MSCG-Net | b7e79d68f14984fe460eff72bcbb8049e4d2bc9f | [
"MIT"
] | 20 | 2020-05-13T07:34:04.000Z | 2022-03-22T11:51:48.000Z | import numpy as np
import torch
from torch import Tensor
from PIL import Image, ImageEnhance
def torch_none(x: Tensor):
return x
def torch_rot90_(x: Tensor):
return x.transpose_(2, 3).flip(2)
def torch_rot90(x: Tensor):
return x.transpose(2, 3).flip(2)
def torch_rot180(x: Tensor):
return x.flip... | 23.105769 | 120 | 0.659176 | import numpy as np
import torch
from torch import Tensor
from PIL import Image, ImageEnhance
def torch_none(x: Tensor):
return x
def torch_rot90_(x: Tensor):
return x.transpose_(2, 3).flip(2)
def torch_rot90(x: Tensor):
return x.transpose(2, 3).flip(2)
def torch_rot180(x: Tensor):
return x.flip... | true | true |
f77c316a24a6cdc2be615699de25d0b777cedf7b | 783 | py | Python | src/dyk.py | AmiMappy/gday | af59fb7539113b2fa0f68f7b71704255c4392f1e | [
"MIT"
] | 2 | 2020-08-10T09:42:51.000Z | 2020-10-02T13:57:51.000Z | src/dyk.py | AmiMappy/gday | af59fb7539113b2fa0f68f7b71704255c4392f1e | [
"MIT"
] | 6 | 2020-08-16T05:42:50.000Z | 2021-10-01T06:35:48.000Z | src/dyk.py | AmiMappy/gday | af59fb7539113b2fa0f68f7b71704255c4392f1e | [
"MIT"
] | 2 | 2020-10-13T03:39:14.000Z | 2020-10-17T08:08:19.000Z | import wikipedia
import os
from bs4 import BeautifulSoup
import sys, os
pathname = os.path.dirname(sys.argv[0])
fullpath = os.path.abspath(pathname)
mpsrc = "https://en.wikipedia.org/wiki/Main_Page"
os.system("touch " + fullpath + "/temp/wmpsrc.html")
os.system("wget " + mpsrc + " -O "+ fullpath + "/temp/wmpsrc.html ... | 32.625 | 114 | 0.662835 | import wikipedia
import os
from bs4 import BeautifulSoup
import sys, os
pathname = os.path.dirname(sys.argv[0])
fullpath = os.path.abspath(pathname)
mpsrc = "https://en.wikipedia.org/wiki/Main_Page"
os.system("touch " + fullpath + "/temp/wmpsrc.html")
os.system("wget " + mpsrc + " -O "+ fullpath + "/temp/wmpsrc.html ... | true | true |
f77c318151af2bbb9c70454ceb38de80c99b4728 | 4,425 | py | Python | pi_power_leds.py | xyd945/pi_power | 081635647459980ff7f326eb76b569316531c384 | [
"MIT"
] | 222 | 2016-09-30T09:31:11.000Z | 2022-02-22T11:08:40.000Z | pi_power_leds.py | xyd945/pi_power | 081635647459980ff7f326eb76b569316531c384 | [
"MIT"
] | 10 | 2017-03-02T18:07:12.000Z | 2019-05-25T02:31:20.000Z | pi_power_leds.py | xyd945/pi_power | 081635647459980ff7f326eb76b569316531c384 | [
"MIT"
] | 44 | 2016-10-06T11:40:44.000Z | 2021-07-06T12:01:18.000Z | #!/usr/bin/env python
# pi_power_led.py
# Copyright (c) 2016 Robert Jones, Craic Computing LLC
# Freely distributed under the terms of the MIT License
# Read the contents of /home/pi/.pi_power_status and light red and green leds accordingly
# The default configuration for the LEDs is Common Anode which works for mo... | 26.981707 | 89 | 0.64452 |
def green_constant():
blink_time_on = 0
blink_time_off = 0
leds = ['green']
update_leds(leds, blink_time_on, blink_time_off)
def red_constant():
blink_time_on = 0
blink_time_off = 0
leds = ['red']
update_leds(leds, blink_time_on, blink_time_off)
def yellow_constant():
bli... | true | true |
f77c32d2bcb864fa44c4bcb13bcced79bfc258cd | 122 | py | Python | seamges/monitoreos/admin.py | jaramosperez/seamges | 8bb522de5a3b73ffc29572d73de898462f76b644 | [
"MIT"
] | null | null | null | seamges/monitoreos/admin.py | jaramosperez/seamges | 8bb522de5a3b73ffc29572d73de898462f76b644 | [
"MIT"
] | 4 | 2021-04-08T21:42:43.000Z | 2021-06-10T19:55:08.000Z | seamges/monitoreos/admin.py | jaramosperez/seamges | 8bb522de5a3b73ffc29572d73de898462f76b644 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Monitoreo
# Register your models here.
admin.site.register(Monitoreo) | 30.5 | 32 | 0.827869 | from django.contrib import admin
from .models import Monitoreo
admin.site.register(Monitoreo) | true | true |
f77c32efdf1ba6ddedf970c1d03f93ba35c3ba39 | 471 | py | Python | app.py | BlueRhino/crazytools | a4b3bc75e8ee58b52c4c4cb16eb7a490593e0d88 | [
"MIT"
] | null | null | null | app.py | BlueRhino/crazytools | a4b3bc75e8ee58b52c4c4cb16eb7a490593e0d88 | [
"MIT"
] | 3 | 2021-06-08T22:05:01.000Z | 2022-01-13T03:05:16.000Z | app.py | BlueRhino/crazytools | a4b3bc75e8ee58b52c4c4cb16eb7a490593e0d88 | [
"MIT"
] | null | null | null | from flask import Flask, current_app, request
from flask import render_template
app = Flask(__name__)
@app.route('/')
def hello_world():
return render_template('index.html')
@app.route('/favicon.ico')
def get_fav():
print(__name__)
return current_app.send_static_file('img/favicon.ico')
@app.route('/e... | 18.115385 | 58 | 0.694268 | from flask import Flask, current_app, request
from flask import render_template
app = Flask(__name__)
@app.route('/')
def hello_world():
return render_template('index.html')
@app.route('/favicon.ico')
def get_fav():
print(__name__)
return current_app.send_static_file('img/favicon.ico')
@app.route('/e... | true | true |
f77c333291a912342330e2e5fe6acd26bbdbab94 | 2,458 | py | Python | messenger/client/preferences_ui.py | marik348/python-messenger | 6c1916b0df439cd997cb6e9376221fe587c3f1c1 | [
"MIT"
] | 2 | 2021-05-24T08:44:51.000Z | 2022-03-17T10:41:48.000Z | messenger/client/preferences_ui.py | marik348/python-messenger | 6c1916b0df439cd997cb6e9376221fe587c3f1c1 | [
"MIT"
] | 1 | 2020-11-28T12:08:25.000Z | 2020-11-28T12:08:25.000Z | messenger/client/preferences_ui.py | marik348/python-messegner | 6c1916b0df439cd997cb6e9376221fe587c3f1c1 | [
"MIT"
] | 1 | 2021-05-24T08:50:42.000Z | 2021-05-24T08:50:42.000Z | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'preferences_ui.ui'
#
# Created by: PyQt5 UI code generator 5.14.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Preferences(object):
def setupUi(self, Preferences):
... | 43.122807 | 278 | 0.702604 |
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Preferences(object):
def setupUi(self, Preferences):
Preferences.setObjectName("Preferences")
Preferences.resize(332, 178)
self.button_box = QtWidgets.QDialogButtonBox(Preferences)
self.button_box.setGeometry(QtCore.QRect(30, 1... | true | true |
f77c3490a2fac5935e0ffd4fa5fc50a5dd01bdf9 | 1,552 | py | Python | day15/d15.py | jcisio/adventofcode2021 | 280e88b636e07772b3793b88d3298586661166e6 | [
"MIT"
] | null | null | null | day15/d15.py | jcisio/adventofcode2021 | 280e88b636e07772b3793b88d3298586661166e6 | [
"MIT"
] | null | null | null | day15/d15.py | jcisio/adventofcode2021 | 280e88b636e07772b3793b88d3298586661166e6 | [
"MIT"
] | null | null | null |
class Problem:
def __init__(self):
self.dist = {}
self.prev = {}
self.edges = {}
self.vertices = set()
self.risk = []
def readInput(self):
f = open(__file__[:-3] + '.in', 'r')
self.risk = []
for line in f.read().strip().split('\n'):
... | 27.714286 | 63 | 0.458119 |
class Problem:
def __init__(self):
self.dist = {}
self.prev = {}
self.edges = {}
self.vertices = set()
self.risk = []
def readInput(self):
f = open(__file__[:-3] + '.in', 'r')
self.risk = []
for line in f.read().strip().split('\n'):
... | true | true |
f77c355077411be97e762a202c13ba78fccb5611 | 56,144 | py | Python | Lib/test/test_pdb.py | XHLearn/Python-3.8.8 | 9e74af604edc14c183e7ed6717bc8faeec18d870 | [
"0BSD"
] | 2 | 2021-06-14T21:41:01.000Z | 2021-06-28T01:00:56.000Z | support/App/Python/Lib/test/test_pdb.py | harshit-gh27/covid-vaccine-booking | 3513bdfcae5890aa8bd7aa9fc69bfdb866e922da | [
"MIT"
] | null | null | null | support/App/Python/Lib/test/test_pdb.py | harshit-gh27/covid-vaccine-booking | 3513bdfcae5890aa8bd7aa9fc69bfdb866e922da | [
"MIT"
] | null | null | null | # A test suite for pdb; not very comprehensive at the moment.
import doctest
import os
import pdb
import sys
import types
import codecs
import unittest
import subprocess
import textwrap
from contextlib import ExitStack
from io import StringIO
from test import support
# This little helper class is essential for testin... | 32.322395 | 121 | 0.556462 |
import doctest
import os
import pdb
import sys
import types
import codecs
import unittest
import subprocess
import textwrap
from contextlib import ExitStack
from io import StringIO
from test import support
from test.test_doctest import _FakeInput
from unittest.mock import patch
class PdbTestInput(object):
def ... | true | true |
f77c35b16714871e3b6460bcf9b28fae31770cd9 | 316 | py | Python | lang/py/pylib/code/sysconfig/sysconfig_get_config_var.py | ch1huizong/learning | 632267634a9fd84a5f5116de09ff1e2681a6cc85 | [
"MIT"
] | 1 | 2022-01-29T08:32:11.000Z | 2022-01-29T08:32:11.000Z | lang/py/pylib/code/sysconfig/sysconfig_get_config_var.py | ch1huizong/learning | 632267634a9fd84a5f5116de09ff1e2681a6cc85 | [
"MIT"
] | null | null | null | lang/py/pylib/code/sysconfig/sysconfig_get_config_var.py | ch1huizong/learning | 632267634a9fd84a5f5116de09ff1e2681a6cc85 | [
"MIT"
] | 1 | 2022-01-29T08:32:12.000Z | 2022-01-29T08:32:12.000Z | #!/usr/bin/env python
# encoding: utf-8
#
# Copyright (c) 2010 Doug Hellmann. All rights reserved.
#
"""All configuration variables.
"""
#end_pymotw_header
import sysconfig
print 'User base directory:', sysconfig.get_config_var('userbase')
print 'Unknown variable :', sysconfig.get_config_var('NoSuchVariable')
| 22.571429 | 72 | 0.75 | """All configuration variables.
"""
import sysconfig
print 'User base directory:', sysconfig.get_config_var('userbase')
print 'Unknown variable :', sysconfig.get_config_var('NoSuchVariable')
| false | true |
f77c35bd331c6d86d3dc0f08d2d3e6dc6def926a | 362 | py | Python | utils.py | 2channelkrt/VLAE | 5fd34127a0805c14b967cc1742c4ac69bf52bb51 | [
"MIT"
] | 57 | 2019-05-19T15:56:33.000Z | 2021-10-05T06:31:39.000Z | utils.py | 2channelkrt/VLAE | 5fd34127a0805c14b967cc1742c4ac69bf52bb51 | [
"MIT"
] | 3 | 2019-06-04T05:01:32.000Z | 2021-02-11T03:51:01.000Z | utils.py | 2channelkrt/VLAE | 5fd34127a0805c14b967cc1742c4ac69bf52bb51 | [
"MIT"
] | 10 | 2019-05-28T13:14:15.000Z | 2020-07-19T15:23:28.000Z | import torch
def clip_grad(gradient, clip_value):
""" clip between clip_min and clip_max
"""
return torch.clamp(gradient, min=-clip_value, max=clip_value)
def clip_grad_norm(gradient, clip_value):
norm = (gradient**2).sum(-1)
divisor = torch.max(torch.ones_like(norm).cuda(), norm / clip_value)
... | 27.846154 | 72 | 0.70442 | import torch
def clip_grad(gradient, clip_value):
return torch.clamp(gradient, min=-clip_value, max=clip_value)
def clip_grad_norm(gradient, clip_value):
norm = (gradient**2).sum(-1)
divisor = torch.max(torch.ones_like(norm).cuda(), norm / clip_value)
return gradient / divisor.unsqueeze(-1)
| true | true |
f77c36298d112290ce9e058d781972e2e671ef70 | 10,837 | py | Python | google/cloud/aiplatform/v1beta1/aiplatform-v1beta1-py/google/cloud/aiplatform_v1beta1/types/prediction_service.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 7 | 2021-02-21T10:39:41.000Z | 2021-12-07T07:31:28.000Z | google/cloud/aiplatform/v1beta1/aiplatform-v1beta1-py/google/cloud/aiplatform_v1beta1/types/prediction_service.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 6 | 2021-02-02T23:46:11.000Z | 2021-11-15T01:46:02.000Z | google/cloud/aiplatform/v1beta1/aiplatform-v1beta1-py/google/cloud/aiplatform_v1beta1/types/prediction_service.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 4 | 2021-01-28T23:25:45.000Z | 2021-08-30T01:55:16.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 39.122744 | 119 | 0.665406 | import proto
from google.api import httpbody_pb2 from google.cloud.aiplatform_v1beta1.types import explanation
from google.protobuf import struct_pb2
__protobuf__ = proto.module(
package='google.cloud.aiplatform.v1beta1',
manifest={
'PredictRequest',
'PredictResponse',
'RawPredictR... | true | true |
f77c387d27eb9ec50ff49e2357242988b3eb00a9 | 125 | py | Python | db_connector/db_credentials.py | Anthony-ferrari/paper_recommendation_system | 14a2717262fb56622c1c632819d79eb60a15814a | [
"MIT"
] | null | null | null | db_connector/db_credentials.py | Anthony-ferrari/paper_recommendation_system | 14a2717262fb56622c1c632819d79eb60a15814a | [
"MIT"
] | 1 | 2021-03-28T03:15:11.000Z | 2021-03-28T03:15:11.000Z | db_connector/db_credentials.py | Anthony-ferrari/paper_recommendation_system | 14a2717262fb56622c1c632819d79eb60a15814a | [
"MIT"
] | 1 | 2021-04-02T14:13:25.000Z | 2021-04-02T14:13:25.000Z | host = "database-2.crrxsiyyabpk.us-east-2.rds.amazonaws.com"
user = "admin"
passwd = "j79m2xW2boiNvSyjDjvp"
db = "papeles"
| 17.857143 | 60 | 0.728 | host = "database-2.crrxsiyyabpk.us-east-2.rds.amazonaws.com"
user = "admin"
passwd = "j79m2xW2boiNvSyjDjvp"
db = "papeles"
| true | true |
f77c3950308a1dc4e914a1b66c587397ad7a2b94 | 215 | py | Python | py/acmacs_whocc/__init__.py | acorg/acmacs-whocc | af508bd4651ffb565cd4cf771200540918b1b2bd | [
"MIT"
] | null | null | null | py/acmacs_whocc/__init__.py | acorg/acmacs-whocc | af508bd4651ffb565cd4cf771200540918b1b2bd | [
"MIT"
] | null | null | null | py/acmacs_whocc/__init__.py | acorg/acmacs-whocc | af508bd4651ffb565cd4cf771200540918b1b2bd | [
"MIT"
] | null | null | null | from .get_recent_merges import get_recent_merges
# ======================================================================
### Local Variables:
### eval: (if (fboundp 'eu-rename-buffer) (eu-rename-buffer))
### End:
| 30.714286 | 72 | 0.474419 | from .get_recent_merges import get_recent_merges
### End:
| true | true |
f77c3a7f76742d4e21d8d48f33bd2867183e0d7f | 1,389 | py | Python | proj4/src/__init__.py | hsyis/object-detection-yolo2-tiny | 507ac8aa2fc1cd9d2e12db9a720a68dceb3a85f0 | [
"MIT"
] | null | null | null | proj4/src/__init__.py | hsyis/object-detection-yolo2-tiny | 507ac8aa2fc1cd9d2e12db9a720a68dceb3a85f0 | [
"MIT"
] | null | null | null | proj4/src/__init__.py | hsyis/object-detection-yolo2-tiny | 507ac8aa2fc1cd9d2e12db9a720a68dceb3a85f0 | [
"MIT"
] | null | null | null | import sys
import numpy as np
import cv2
import time
import argparse
import yolov2tiny
def resize_input(im):
imsz = cv2.resize(im, (416, 416))
imsz = imsz / 255.0
imsz = imsz[:, :, ::-1]
return np.asarray(imsz, dtype=np.float32)
def image_object_detection(in_image, out_image, debug):
frame = cv... | 25.254545 | 82 | 0.673866 | import sys
import numpy as np
import cv2
import time
import argparse
import yolov2tiny
def resize_input(im):
imsz = cv2.resize(im, (416, 416))
imsz = imsz / 255.0
imsz = imsz[:, :, ::-1]
return np.asarray(imsz, dtype=np.float32)
def image_object_detection(in_image, out_image, debug):
frame = cv... | true | true |
f77c3aaf038f854c41501a1997522b3383e2438b | 4,540 | py | Python | antlir/rpm/repo_sizer.py | facebookincubator/fs_image | 3515a24bb0e93176a5584bdc8839464fa28390d7 | [
"MIT"
] | 9 | 2019-12-02T20:17:35.000Z | 2020-06-13T16:34:25.000Z | antlir/rpm/repo_sizer.py | facebookincubator/fs_image | 3515a24bb0e93176a5584bdc8839464fa28390d7 | [
"MIT"
] | 19 | 2019-11-22T23:30:04.000Z | 2020-07-16T18:05:48.000Z | antlir/rpm/repo_sizer.py | facebookincubator/fs_image | 3515a24bb0e93176a5584bdc8839464fa28390d7 | [
"MIT"
] | 4 | 2019-12-04T19:03:28.000Z | 2020-06-13T16:34:29.000Z | #!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Repos in `yum.conf` can (and do) share Repodata and Rpm objects, so the best
estimate of their total space usage ... | 39.478261 | 80 | 0.678855 |
from collections import defaultdict
from typing import Any, Dict, NamedTuple, Union
from antlir.unionfind import UnionFind
from .common import Checksum
from .repo_objects import Repodata, RepoMetadata, Rpm
RepoObjectVisitor = Any
class Synonyms(NamedTuple):
checksum_size: Dict[Checksum, int]
... | true | true |
f77c3c4102dacbb2d65427c73b00e0b6ee8c13ea | 1,697 | py | Python | neutronclient/tests/unit/qos/test_cli20_rule.py | casual-lemon/python-neutronclient | adf21f028827b8a4e32057334db4cd464c24c4d0 | [
"Apache-2.0"
] | 120 | 2015-01-07T00:38:58.000Z | 2021-12-26T13:05:53.000Z | neutronclient/tests/unit/qos/test_cli20_rule.py | casual-lemon/python-neutronclient | adf21f028827b8a4e32057334db4cd464c24c4d0 | [
"Apache-2.0"
] | 1 | 2021-08-11T18:42:30.000Z | 2021-08-11T22:25:21.000Z | neutronclient/tests/unit/qos/test_cli20_rule.py | casual-lemon/python-neutronclient | adf21f028827b8a4e32057334db4cd464c24c4d0 | [
"Apache-2.0"
] | 153 | 2015-01-05T16:50:50.000Z | 2021-09-13T12:01:23.000Z | # Copyright 2015 Huawei Technologies India Pvt Ltd.
# All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | 37.711111 | 78 | 0.635239 |
import sys
from neutronclient.neutron.v2_0.qos import rule as qos_rule
from neutronclient.tests.unit import test_cli20
class CLITestV20QoSRuleJSON(test_cli20.CLITestV20Base):
non_admin_status_resources = ['bandwidth_limit_rule',
'dscp_marking_rule',
... | true | true |
f77c3d1920eb09cf4eb1b3cb385a3b5847ea9c81 | 32,304 | py | Python | DnD v2.py | huntercas315/school-final | de6abbedc23c8d37136876d38dbd79dba7672ab4 | [
"MIT"
] | 1 | 2021-06-09T01:03:46.000Z | 2021-06-09T01:03:46.000Z | DnD v2.py | huntercas315/school-final | de6abbedc23c8d37136876d38dbd79dba7672ab4 | [
"MIT"
] | 17 | 2021-06-09T04:55:13.000Z | 2021-06-18T18:05:25.000Z | DnD v2.py | huntercas315/school-final | de6abbedc23c8d37136876d38dbd79dba7672ab4 | [
"MIT"
] | null | null | null | import math
from random import randrange
quitCheck = False # This variable is what triggers quitting the game
beta = False # This disables the beta cheats
class helpTips:
def helpOpening(self) -> None: # Displays a help menu to the player
print("\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~... | 40.736444 | 157 | 0.522536 | import math
from random import randrange
quitCheck = False beta = False
class helpTips:
def helpOpening(self) -> None: print("\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
print("Help And Intstructions:\n")
print("(m)ovement Instructions")
print("(... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.