max_stars_repo_path stringlengths 4 286 | max_stars_repo_name stringlengths 5 119 | max_stars_count int64 0 191k | id stringlengths 1 7 | content stringlengths 6 1.03M | content_cleaned stringlengths 6 1.03M | language stringclasses 111
values | language_score float64 0.03 1 | comments stringlengths 0 556k | edu_score float64 0.32 5.03 | edu_int_score int64 0 5 |
|---|---|---|---|---|---|---|---|---|---|---|
utils/NNspecifications.py | webclinic017/time-series-pipeline | 3 | 6623751 | <filename>utils/NNspecifications.py
import tensorflow as tf
from tensorflow import keras as k
from keras_tuner import HyperModel
from matplotlib import pyplot as plt
class NNmodel(HyperModel):
def __init__(self, input_shape, num_classes):
self.input_shape = input_shape
self.num_classes = num_class... | <filename>utils/NNspecifications.py
import tensorflow as tf
from tensorflow import keras as k
from keras_tuner import HyperModel
from matplotlib import pyplot as plt
class NNmodel(HyperModel):
def __init__(self, input_shape, num_classes):
self.input_shape = input_shape
self.num_classes = num_class... | en | 0.193159 | # Hyperparameter search space # activation_i=hp.Choice('hidden_activation_i',values=['relu', 'tanh', 'softmax'],default='relu') # # Initial hidden layers # activation_i=hp.Choice('hidden_activation_i',values=['relu', 'tanh', 'softmax'],default='relu') # l2regularization_i= hp.Float('l2regularization_i',min_value=0.0001... | 2.746726 | 3 |
lambda.py | jessedeveloperinvestor/Multiple-Jesse-Projects | 0 | 6623752 | <reponame>jessedeveloperinvestor/Multiple-Jesse-Projects<filename>lambda.py
x=lambda a, b: a*b
print(x(5,6))
items=range(1,8)
multiples_of_two=list(map(lambda var: var*2, items))
print(multiples_of_two) | x=lambda a, b: a*b
print(x(5,6))
items=range(1,8)
multiples_of_two=list(map(lambda var: var*2, items))
print(multiples_of_two) | none | 1 | 3.413563 | 3 | |
python/.ipynb_checkpoints/Data Cleaner-checkpoint.py | EricParapini/fifaoptimization | 0 | 6623753 | <reponame>EricParapini/fifaoptimization
#!/usr/bin/env python
# coding: utf-8
# # The Data Cleaning Notebook
#
# This notebook documents the cleaning process for the Fifa 2019 Data. It creates a new csv file in ./data/out/clean.csv
# ## Import necessary libraries
# In[1]:
import numpy as np
import pandas as pd
im... | #!/usr/bin/env python
# coding: utf-8
# # The Data Cleaning Notebook
#
# This notebook documents the cleaning process for the Fifa 2019 Data. It creates a new csv file in ./data/out/clean.csv
# ## Import necessary libraries
# In[1]:
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import sea... | en | 0.603733 | #!/usr/bin/env python # coding: utf-8 # # The Data Cleaning Notebook # # This notebook documents the cleaning process for the Fifa 2019 Data. It creates a new csv file in ./data/out/clean.csv # ## Import necessary libraries # In[1]: # ## Load Data to a data table # In[2]: # # Manipulation # ## Convert the value and wag... | 3.359031 | 3 |
Sheller.py | bantya/Sheller | 3 | 6623754 | import sublime_plugin
import subprocess
import sublime
import shlex
import os
class ShellerCommand(sublime_plugin.TextCommand):
def __init__ (self, *args, **kwargs):
super(ShellerCommand, self).__init__(*args, **kwargs)
def run (self, *args, **kwargs):
command = kwargs.get('command', None)
... | import sublime_plugin
import subprocess
import sublime
import shlex
import os
class ShellerCommand(sublime_plugin.TextCommand):
def __init__ (self, *args, **kwargs):
super(ShellerCommand, self).__init__(*args, **kwargs)
def run (self, *args, **kwargs):
command = kwargs.get('command', None)
... | none | 1 | 2.461685 | 2 | |
rally/rally-plugins/subnet-router-create/subnet-router-create.py | jtaleric/browbeat | 23 | 6623755 | from rally.task import atomic
from rally.task import scenario
from rally.plugins.openstack.scenarios.nova import utils as nova_utils
from rally.plugins.openstack.scenarios.neutron import utils as neutron_utils
from rally.task import types
from rally.task import utils as task_utils
from rally.task import validation
cla... | from rally.task import atomic
from rally.task import scenario
from rally.plugins.openstack.scenarios.nova import utils as nova_utils
from rally.plugins.openstack.scenarios.neutron import utils as neutron_utils
from rally.task import types
from rally.task import utils as task_utils
from rally.task import validation
cla... | none | 1 | 1.93647 | 2 | |
tests/fgnhg_test.py | sg893052/sonic-utilities | 0 | 6623756 | <reponame>sg893052/sonic-utilities<filename>tests/fgnhg_test.py
import os
import traceback
from click.testing import CliRunner
import config.main as config
import show.main as show
from utilities_common.db import Db
show_fgnhg_hash_view_output="""\
FG NHG Prefix Next Hop Hash buckets
--------------- ... | import os
import traceback
from click.testing import CliRunner
import config.main as config
import show.main as show
from utilities_common.db import Db
show_fgnhg_hash_view_output="""\
FG NHG Prefix Next Hop Hash buckets
--------------- ------------------ ------------------------------
192.168.127.1... | en | 0.307607 | \ FG NHG Prefix Next Hop Hash buckets --------------- ------------------ ------------------------------ 192.168.127.12/32 172.16.17.32 0 1 2 3 4 5 6 7 192.168.127.12/32 172.16.31.10 8 9 10 11 12 13 14 15 fc:5::/128 fd00:a516:7c1b:17cd:6d81:2137:bd2a:2c5b 0 1... | 2.118709 | 2 |
kapsoya/migrations/0001_initial.py | Chebichii-Lab/Kapsoya-Estate | 0 | 6623757 | <gh_stars>0
# Generated by Django 3.2.5 on 2021-07-25 10:38
import cloudinary.models
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(sett... | # Generated by Django 3.2.5 on 2021-07-25 10:38
import cloudinary.models
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_US... | en | 0.825989 | # Generated by Django 3.2.5 on 2021-07-25 10:38 | 1.808814 | 2 |
app/recipe/tests/test_ingredient_api.py | Dr4g0s/recipe-app-api | 0 | 6623758 | <reponame>Dr4g0s/recipe-app-api<gh_stars>0
from django.contrib.auth import get_user_model
from django.test import TestCase
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APIClient
from core.models import Ingredient, Recipe
from recipe.serializers import IngredientSeria... | from django.contrib.auth import get_user_model
from django.test import TestCase
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APIClient
from core.models import Ingredient, Recipe
from recipe.serializers import IngredientSerializer
INGREDIENT_URL = reverse('recipe:in... | en | 0.531918 | Test filtering ingredients by assigning returns unique items | 2.438246 | 2 |
custom_layer_constraints.py | XiaowanYi/Attention_vgg16 | 3 | 6623759 | <gh_stars>1-10
# -*- coding: utf-8 -*-
"""
Customized singly connected layer
"""
import keras
from keras.models import Sequential, Model
from keras import backend as K
from keras.layers import Layer
import numpy as np
#Customize a constraint class that clip w to be [K.epsilon(), inf]
from keras.constraints import Co... | # -*- coding: utf-8 -*-
"""
Customized singly connected layer
"""
import keras
from keras.models import Sequential, Model
from keras import backend as K
from keras.layers import Layer
import numpy as np
#Customize a constraint class that clip w to be [K.epsilon(), inf]
from keras.constraints import Constraint
class... | en | 0.555009 | # -*- coding: utf-8 -*- Customized singly connected layer #Customize a constraint class that clip w to be [K.epsilon(), inf] #Customize a element-wise multiplication layer with trainable weights #self.input_spec = InputSpec(ndim=len(input_shape), # axes=dict(list(enumerate(input_shape[1:], sta... | 2.717219 | 3 |
ils_loc_mapper/lib/mapper_helper.py | birkin/ils_location_mapper_project | 0 | 6623760 | # -*- coding: utf-8 -*-
import datetime, json, logging, pprint
from . import common
from django.core.cache import cache
from django.http import HttpResponse, HttpResponseBadRequest, HttpResponseNotFound, HttpResponseServerError
from ils_loc_mapper import settings_app
from ils_loc_mapper.models import LocationCodeMappe... | # -*- coding: utf-8 -*-
import datetime, json, logging, pprint
from . import common
from django.core.cache import cache
from django.http import HttpResponse, HttpResponseBadRequest, HttpResponseNotFound, HttpResponseServerError
from ils_loc_mapper import settings_app
from ils_loc_mapper.models import LocationCodeMappe... | en | 0.741206 | # -*- coding: utf-8 -*- Validates params. Called by views.map_location_code() Returns `code` or `dump`. Called by views.map_location_code() Performs lookup & returns data. Called by views.map_location_code() Returns match from cache or db lookup. Called by prep_code_data(... | 2.025477 | 2 |
fsleyes/tests/test_screenshot.py | pauldmccarthy/fsleyes | 12 | 6623761 | <reponame>pauldmccarthy/fsleyes
#!/usr/bin/env python
#
# test_screenshot.py - Test fsleyes.actions.screenshot
#
# Author: <NAME> <<EMAIL>>
#
import os.path as op
import fsl.data.image as fslimage
import fsl.utils.idle as idle
from fsleyes.tests import (run_with_orthopanel,
ru... | #!/usr/bin/env python
#
# test_screenshot.py - Test fsleyes.actions.screenshot
#
# Author: <NAME> <<EMAIL>>
#
import os.path as op
import fsl.data.image as fslimage
import fsl.utils.idle as idle
from fsleyes.tests import (run_with_orthopanel,
run_with_lightboxpanel,
... | en | 0.231237 | #!/usr/bin/env python # # test_screenshot.py - Test fsleyes.actions.screenshot # # Author: <NAME> <<EMAIL>> # | 2.101018 | 2 |
Ex049.py | leonardoDelefrate/Curso-de-Python | 0 | 6623762 | <reponame>leonardoDelefrate/Curso-de-Python<filename>Ex049.py
import datetime
h = datetime.date.today().year
tma = 0
tme = 0
for p in range(1,8):
ano = int(input('Em que ano a {}° pessoa nasceu? '.format(p)))
idade = h - ano
if idade >= 18:
tma += 1
else:
tme += 1
print('{} pessoas ating... | import datetime
h = datetime.date.today().year
tma = 0
tme = 0
for p in range(1,8):
ano = int(input('Em que ano a {}° pessoa nasceu? '.format(p)))
idade = h - ano
if idade >= 18:
tma += 1
else:
tme += 1
print('{} pessoas atingiram a maioridade.'.format(tma))
print('{} pessoas ainda não a... | none | 1 | 3.839503 | 4 | |
process/introduce_wer.py | judyfong/punctuation-prediction | 43 | 6623763 | <gh_stars>10-100
# Copyright 2020 <NAME> <EMAIL>
# In this script, the word error rate is introduced to data
# and the data then saved to a file.
from wer_assist import apply_wer
import sys
try:
wordList_wer = apply_wer(float(sys.argv[3]))
sentences_wer = [" ".join(sentence) for sentence in wordList_wer]
excep... | # Copyright 2020 <NAME> <EMAIL>
# In this script, the word error rate is introduced to data
# and the data then saved to a file.
from wer_assist import apply_wer
import sys
try:
wordList_wer = apply_wer(float(sys.argv[3]))
sentences_wer = [" ".join(sentence) for sentence in wordList_wer]
except:
print("The... | en | 0.804188 | # Copyright 2020 <NAME> <EMAIL> # In this script, the word error rate is introduced to data # and the data then saved to a file. | 3.262791 | 3 |
aerismodsdk/modules/quectel.py | ethaeris/aeris-modsdk-py | 0 | 6623764 | <gh_stars>0
"""
Copyright 2020 Aeris Communications Inc.
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
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | """
Copyright 2020 Aeris Communications Inc.
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
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writi... | en | 0.726031 | Copyright 2020 Aeris Communications Inc. 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 https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, ... | 1.762679 | 2 |
textkit/tokenize/bigrams.py | learntextvis/textkit | 29 | 6623765 | <reponame>learntextvis/textkit<gh_stars>10-100
import click
import nltk
from textkit.utils import output, read_tokens
@click.command()
@click.argument('tokens', type=click.File('r'), default=click.open_file('-'))
@click.option('-s', '--sep', default=' ',
help='Separator between words in bigram output.',... | import click
import nltk
from textkit.utils import output, read_tokens
@click.command()
@click.argument('tokens', type=click.File('r'), default=click.open_file('-'))
@click.option('-s', '--sep', default=' ',
help='Separator between words in bigram output.',
show_default=True)
def words2big... | en | 0.936847 | Tokenize words into bigrams. Bigrams are two word tokens. Punctuation is considered as a separate token. | 3.287188 | 3 |
psafe3-to-keepass-csv.py | hupf/psafe3-to-keepass-csv | 0 | 6623766 | import sys
import csv
from datetime import datetime
from argparse import ArgumentParser
from getpass import getpass
from loxodo.vault import Vault
class HelpfulArgumentParser(ArgumentParser):
def error(self, message):
sys.stderr.write('error: %s\n' % message)
self.print_help()
sys.exit(2)
... | import sys
import csv
from datetime import datetime
from argparse import ArgumentParser
from getpass import getpass
from loxodo.vault import Vault
class HelpfulArgumentParser(ArgumentParser):
def error(self, message):
sys.stderr.write('error: %s\n' % message)
self.print_help()
sys.exit(2)
... | en | 0.742821 | # group # title # username # password # url # notes # last mofified | 3.011438 | 3 |
test.py | deep-compute/gmaildump | 0 | 6623767 | import doctest
import unittest
from gmaildump import gmailhistory
def suitefn():
suite = unittest.TestSuite()
suite.addTests(doctest.DocTestSuite(gmailhistory))
return suite
if __name__ == "__main__":
doctest.testmod(gmailhistory)
| import doctest
import unittest
from gmaildump import gmailhistory
def suitefn():
suite = unittest.TestSuite()
suite.addTests(doctest.DocTestSuite(gmailhistory))
return suite
if __name__ == "__main__":
doctest.testmod(gmailhistory)
| none | 1 | 1.794396 | 2 | |
molecule/default/tests/test_namenodes.py | mikemillerr/ansible-hdfs | 19 | 6623768 | <gh_stars>10-100
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
'.molecule/inventory').get_hosts('namenodes')
def test_hdfs_printTopology_command(Sudo, Command):
with Sudo("hdfs"):
c = Command("/usr/local/hadoop/bin/hdfs dfsadmin -printTopology")... | import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
'.molecule/inventory').get_hosts('namenodes')
def test_hdfs_printTopology_command(Sudo, Command):
with Sudo("hdfs"):
c = Command("/usr/local/hadoop/bin/hdfs dfsadmin -printTopology")
assert ... | none | 1 | 2.040877 | 2 | |
gntp/readers/sru.py | nagendra20001414/gntp | 0 | 6623769 | # -*- coding: utf-8 -*-
import numpy as np
import tensorflow as tf
class SRUFusedRNN(tf.contrib.rnn.FusedRNNCell):
"""Simple Recurrent Unit, very fast. https://openreview.net/pdf?id=rJBiunlAW"""
def __init__(self, num_units, f_bias=1.0, r_bias=0.0, with_residual=True):
self._num_units = num_units
... | # -*- coding: utf-8 -*-
import numpy as np
import tensorflow as tf
class SRUFusedRNN(tf.contrib.rnn.FusedRNNCell):
"""Simple Recurrent Unit, very fast. https://openreview.net/pdf?id=rJBiunlAW"""
def __init__(self, num_units, f_bias=1.0, r_bias=0.0, with_residual=True):
self._num_units = num_units
... | en | 0.732199 | # -*- coding: utf-8 -*- Simple Recurrent Unit, very fast. https://openreview.net/pdf?id=rJBiunlAW Simple Recurrent Unit, very fast. https://openreview.net/pdf?id=rJBiunlAW Simple recurrent unit (SRU). | 2.678876 | 3 |
reframed/cobra/variability.py | xuanyuanXIV/reframed | 30 | 6623770 | <reponame>xuanyuanXIV/reframed
from ..solvers import solver_instance
from ..solvers.solution import Status
from .simulation import FBA
from .thermodynamics import llFBA
from warnings import warn
from math import inf
def FVA(model, obj_frac=0, reactions=None, constraints=None, loopless=False, internal=None, solver=Non... | from ..solvers import solver_instance
from ..solvers.solution import Status
from .simulation import FBA
from .thermodynamics import llFBA
from warnings import warn
from math import inf
def FVA(model, obj_frac=0, reactions=None, constraints=None, loopless=False, internal=None, solver=None):
""" Run Flux Variabilit... | en | 0.680313 | Run Flux Variability Analysis (FVA). Arguments: model (CBModel): a constraint-based model obj_frac (float): minimum fraction of the maximum growth rate (default 0.0, max: 1.0) reactions (list): list of reactions to analyze (default: all) constraints (dict): additional constraints (o... | 2.234643 | 2 |
map/models.py | matthewoconnor/mapplot-cdp | 0 | 6623771 | <gh_stars>0
import re
import requests
import matplotlib.path as matplotlib_path
import numpy as np
from pyquery import PyQuery as pq
from sodapy import Socrata
from django.db import models
from django.utils import timezone
from django.template.loader import render_to_string
from django.core.files.base import ContentF... | import re
import requests
import matplotlib.path as matplotlib_path
import numpy as np
from pyquery import PyQuery as pq
from sodapy import Socrata
from django.db import models
from django.utils import timezone
from django.template.loader import render_to_string
from django.core.files.base import ContentFile
from dja... | en | 0.761348 | A single enclosed area #n,e,s,w SHOUlD SEPARATE INTO INDIVIDUAL FIELDS TO HELP QUERY ON LARGER tests if a point is within this area test for minumum bounding rectangle before trying more expensive contains_point method tests if a point is within this area test for minumu... | 2.015265 | 2 |
Python/RoadLineDetector/RoadLineDetector.py | thefool76/hacktoberfest2021 | 448 | 6623772 | import cv2
import numpy as np
from matplotlib import pyplot as plt
def roi(image,vertices):
mask=np.zeros_like(image)
cv2.fillPoly(mask,vertices,255)
masked_image=cv2.bitwise_and(image,mask)
return masked_image
def image_with_lines(image,lines):
image=np.copy(image)
blank_image=np.zeros((image.... | import cv2
import numpy as np
from matplotlib import pyplot as plt
def roi(image,vertices):
mask=np.zeros_like(image)
cv2.fillPoly(mask,vertices,255)
masked_image=cv2.bitwise_and(image,mask)
return masked_image
def image_with_lines(image,lines):
image=np.copy(image)
blank_image=np.zeros((image.... | none | 1 | 3.003423 | 3 | |
simple_detection.py | hoerldavid/nis-automation | 0 | 6623773 | from skimage.morphology import remove_small_holes, binary_erosion
from skimage.measure import regionprops, label
from skimage.filters import threshold_local
from skimage.morphology import disk, binary_opening
from skimage.exposure import rescale_intensity
from scipy.ndimage.filters import gaussian_filter
from skimage.t... | from skimage.morphology import remove_small_holes, binary_erosion
from skimage.measure import regionprops, label
from skimage.filters import threshold_local
from skimage.morphology import disk, binary_opening
from skimage.exposure import rescale_intensity
from scipy.ndimage.filters import gaussian_filter
from skimage.t... | en | 0.676085 | old pixel->unit conversion for bounding boxes NB: may no be corect TODO: remove if it is no longer necessary get inverse aspect ratio a bounding box (smaller axis/larger axis) Parameters ---------- bbox: 4-tuple ymin, xmin, ymax, xmax Returns ------- aspect: scalar inver... | 1.946423 | 2 |
python/gvgai/tests/non_gym_client.py | aadharna/GVGAI_GYM | 0 | 6623774 | import logging
import time
import numpy as np
from gvgai.gym import GVGAI_Env
from gvgai.utils.level_data_generator import SokobanGenerator
if __name__ == '__main__':
# Turn debug logging on
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger('Test Agent')
level_generator = SokobanGe... | import logging
import time
import numpy as np
from gvgai.gym import GVGAI_Env
from gvgai.utils.level_data_generator import SokobanGenerator
if __name__ == '__main__':
# Turn debug logging on
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger('Test Agent')
level_generator = SokobanGe... | en | 0.923072 | # Turn debug logging on # choose action based on trained policy # do action and get new state and its reward #time.sleep(1) # break loop when terminal state is reached | 2.300094 | 2 |
mysite/urls.py | thetruefuss/theoctopuslibrary | 4 | 6623775 | <gh_stars>1-10
"""mysite URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='h... | """mysite URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-bas... | en | 0.616317 | mysite URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-based ... | 2.732517 | 3 |
bin/run_p4_mininet.py | termlen0/transparent-security | 1 | 6623776 | #!/usr/bin/env python2
# Copyright (c) 2019 Cable Television Laboratories, Inc.
# 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 req... | #!/usr/bin/env python2
# Copyright (c) 2019 Cable Television Laboratories, Inc.
# 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 req... | en | 0.838065 | #!/usr/bin/env python2 # Copyright (c) 2019 Cable Television Laboratories, Inc. # 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 requ... | 2.037633 | 2 |
bluebottle/fsm/effects.py | terrameijar/bluebottle | 10 | 6623777 | from collections import Iterable
from functools import partial
from builtins import str
from builtins import object
from django.utils.translation import gettext_lazy as _
from django.template.loader import render_to_string
from future.utils import python_2_unicode_compatible
from bluebottle.fsm.state import Transitio... | from collections import Iterable
from functools import partial
from builtins import str
from builtins import object
from django.utils.translation import gettext_lazy as _
from django.template.loader import render_to_string
from future.utils import python_2_unicode_compatible
from bluebottle.fsm.state import Transitio... | none | 1 | 2.100582 | 2 | |
_utils/_2021_10_09_update_timeline.py | jeromecyang/ltsoj | 0 | 6623778 | <reponame>jeromecyang/ltsoj
from lib import *
episodes = get_all_episodes()
for episode in [e for e in episodes[:41] if not e in ['ep017.md', 'ep026.md', 'ep035.md']]:
content = read_content(episode)
timeline = get_section(content, 1)
lines = re.findall(r'\*.*?\n', timeline, flags=re.S)
output = '\n'
for lin... | from lib import *
episodes = get_all_episodes()
for episode in [e for e in episodes[:41] if not e in ['ep017.md', 'ep026.md', 'ep035.md']]:
content = read_content(episode)
timeline = get_section(content, 1)
lines = re.findall(r'\*.*?\n', timeline, flags=re.S)
output = '\n'
for line in lines:
parts = line... | none | 1 | 2.632948 | 3 | |
onmt/decoders/tree_decoder.py | longhuei/tree2seq-terminology-translation | 2 | 6623779 | <gh_stars>1-10
"""tree_decoder.py - Sequential or Tree-generator decoder models
Written by OpenNMT (https://github.com/OpenNMT/OpenNMT-py)
Rewritten in 2018 by <NAME> <<EMAIL>>
To the extent possible under law, the author(s) have dedicated all copyright
and related and neighboring rights to this software to the publi... | """tree_decoder.py - Sequential or Tree-generator decoder models
Written by OpenNMT (https://github.com/OpenNMT/OpenNMT-py)
Rewritten in 2018 by <NAME> <<EMAIL>>
To the extent possible under law, the author(s) have dedicated all copyright
and related and neighboring rights to this software to the public domain
worldw... | en | 0.84515 | tree_decoder.py - Sequential or Tree-generator decoder models Written by OpenNMT (https://github.com/OpenNMT/OpenNMT-py) Rewritten in 2018 by <NAME> <<EMAIL>> To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide... | 2.022932 | 2 |
django_project/django/panoramas/libs.py | wowcube/webprojector | 0 | 6623780 | # -*- coding: utf-8 -*-
from io import BytesIO
import requests
from PIL import Image
from django.conf import settings
def get_panoram_frame(location, heading, pitch):
base_url = 'https://maps.googleapis.com/maps/api/streetview?size=480x480'
key = settings.GOOGLE_STREETVIEW_KEY
fov = 90
im_url = base_u... | # -*- coding: utf-8 -*-
from io import BytesIO
import requests
from PIL import Image
from django.conf import settings
def get_panoram_frame(location, heading, pitch):
base_url = 'https://maps.googleapis.com/maps/api/streetview?size=480x480'
key = settings.GOOGLE_STREETVIEW_KEY
fov = 90
im_url = base_u... | en | 0.289721 | # -*- coding: utf-8 -*- # горизонтальный угол # вертикальный угол # print("img_io") # left_side = 350 # watermark = Image.open('panorams/space/watermark.png') # img.paste(watermark, (left_side,460+480), mask=watermark) # img.paste(watermark, (left_side+480,460+480), mask=watermark) # img.paste(watermark, (left_side+480... | 2.409548 | 2 |
momo_api/cron.py | Foris-master/momo_server | 0 | 6623781 | <gh_stars>0
import difflib
from time import time
from django_cron import CronJobBase, Schedule
from momo_api.lib import proceed_transactions
class ProceedTransactionJob(CronJobBase):
RUN_EVERY_MINS = 1 # every 5 minutes
schedule = Schedule(run_every_mins=RUN_EVERY_MINS)
code = 'momo_server.fetch_stati... | import difflib
from time import time
from django_cron import CronJobBase, Schedule
from momo_api.lib import proceed_transactions
class ProceedTransactionJob(CronJobBase):
RUN_EVERY_MINS = 1 # every 5 minutes
schedule = Schedule(run_every_mins=RUN_EVERY_MINS)
code = 'momo_server.fetch_stations' # a un... | en | 0.701229 | # every 5 minutes # a unique code | 2.318844 | 2 |
ariane/apps/users/views.py | DebVortex/ariane-old- | 0 | 6623782 | from braces.views import LoginRequiredMixin
from django.contrib import messages
from django.utils.translation import ugettext_lazy as _
from django.views.generic import FormView
from . import forms, models
class UpdateUserSettingsView(LoginRequiredMixin, FormView):
"""View for the user to update his settings.""... | from braces.views import LoginRequiredMixin
from django.contrib import messages
from django.utils.translation import ugettext_lazy as _
from django.views.generic import FormView
from . import forms, models
class UpdateUserSettingsView(LoginRequiredMixin, FormView):
"""View for the user to update his settings.""... | en | 0.85757 | View for the user to update his settings. Return the UserSetting of the current user. If the user has no related UserSetting, it gets created. Returns: UserSetting: the UserSetting object of the current user Return the keyword arguments for the form. Returns: Dict: the... | 2.264576 | 2 |
core/migrations/0008_auto_20180704_2340.py | mertyildiran/echo | 5 | 6623783 | <reponame>mertyildiran/echo
# Generated by Django 2.0.6 on 2018-07-04 23:40
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('core', '0007_auto_20180704_2241'),
]
operations = [
migrations.RenameField(
model_name='profile',
... | # Generated by Django 2.0.6 on 2018-07-04 23:40
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('core', '0007_auto_20180704_2241'),
]
operations = [
migrations.RenameField(
model_name='profile',
old_name='location',
... | en | 0.697693 | # Generated by Django 2.0.6 on 2018-07-04 23:40 | 1.719107 | 2 |
API-extract/keras/extract_members.py | sqlab-sustech/PyCompat | 4 | 6623784 | <filename>API-extract/keras/extract_members.py<gh_stars>1-10
#! /usr/bin/python3
from library_traverser import traverse_module, MemberVisitor, MemberInfoExtractor
import re
import inspect
import pymongo
import importlib
import pkgutil
import keras
sub_modules = [m for m in pkgutil.iter_modules(keras.__path__) if m[2... | <filename>API-extract/keras/extract_members.py<gh_stars>1-10
#! /usr/bin/python3
from library_traverser import traverse_module, MemberVisitor, MemberInfoExtractor
import re
import inspect
import pymongo
import importlib
import pkgutil
import keras
sub_modules = [m for m in pkgutil.iter_modules(keras.__path__) if m[2... | ru | 0.256886 | #! /usr/bin/python3 # From tensorflow source # Arguments\n)((\ {4}\w+:\s[\S\ ]+(\n\ {4}[\S\ ]+)*\n*)+)") # Raises\n)((\ {4}[\S\ ]+)(\n\ {8}[\S\ ]+)+)") | 2.27749 | 2 |
datastorm/limits/batching.py | JavierLuna/datastorm | 13 | 6623785 | MAX_BATCH_SIZE = 500
| MAX_BATCH_SIZE = 500
| none | 1 | 1.067802 | 1 | |
testsrc/collectortests.py | paulharter/biofeed | 0 | 6623786 | <filename>testsrc/collectortests.py
import unittest
from biofeedCollector import DataCollector
TEST_DATA = ({"one":154.7,
"two":66.0,
"three":44.1,
"four":5.6},
{"one":158.4,
"two":66.2,
"three":55.3,
"four":6.4},
... | <filename>testsrc/collectortests.py
import unittest
from biofeedCollector import DataCollector
TEST_DATA = ({"one":154.7,
"two":66.0,
"three":44.1,
"four":5.6},
{"one":158.4,
"two":66.2,
"three":55.3,
"four":6.4},
... | en | 0.759572 | #repeats if no new value #average if not got for two or more #reset by last get | 2.662333 | 3 |
accelerometer/src/lsm_iic.py | JGoard/teensy-rs485-arm-control | 3 | 6623787 | <reponame>JGoard/teensy-rs485-arm-control<filename>accelerometer/src/lsm_iic.py
#!/usr/bin/env python3
import board
import busio
import rospy
from adafruit_lsm6ds.lsm6dsox import LSM6DSOX
from sensor_msgs.msg import Imu
def main():
rospy.init_node('accelerometer', anonymous=False)
pub = rospy.Publisher("imu... | #!/usr/bin/env python3
import board
import busio
import rospy
from adafruit_lsm6ds.lsm6dsox import LSM6DSOX
from sensor_msgs.msg import Imu
def main():
rospy.init_node('accelerometer', anonymous=False)
pub = rospy.Publisher("imu", Imu, queue_size=10)
print(board.SCL, board.SDA)
i2c = busio.I2C... | fr | 0.221828 | #!/usr/bin/env python3 | 2.498763 | 2 |
AdnReport/Adn_Report.py | METIS-GEO/plugins | 0 | 6623788 | # -*- coding: utf-8 -*-
"""
/***************************************************************************
AdnReport
A QGIS plugin
Prégénérer les fichiers et dossier pour la génération de rapport pour ADN
-------------------
begin : 2... | # -*- coding: utf-8 -*-
"""
/***************************************************************************
AdnReport
A QGIS plugin
Prégénérer les fichiers et dossier pour la génération de rapport pour ADN
-------------------
begin : 2... | en | 0.514349 | # -*- coding: utf-8 -*- /*************************************************************************** AdnReport A QGIS plugin Prégénérer les fichiers et dossier pour la génération de rapport pour ADN ------------------- begin : 2018-... | 1.569821 | 2 |
src/py42/sdk/queries/__init__.py | code42/py42 | 21 | 6623789 | from py42 import settings
from py42.sdk.queries.query_filter import FilterGroup
class BaseQuery:
def __init__(self, *args, **kwargs):
self._filter_group_list = list(args)
self._group_clause = kwargs.get("group_clause", "AND")
self.page_number = kwargs.get("page_number") or 1
self.p... | from py42 import settings
from py42.sdk.queries.query_filter import FilterGroup
class BaseQuery:
def __init__(self, *args, **kwargs):
self._filter_group_list = list(args)
self._group_clause = kwargs.get("group_clause", "AND")
self.page_number = kwargs.get("page_number") or 1
self.p... | en | 0.394336 | # Override | 2.428676 | 2 |
qcportal/records/optimization/__init__.py | bennybp/QCPortal | 0 | 6623790 | from .models import (
OptimizationRecord,
OptimizationProtocols,
OptimizationSpecification,
OptimizationInputSpecification,
OptimizationQCInputSpecification,
OptimizationQueryBody,
OptimizationAddBody,
)
| from .models import (
OptimizationRecord,
OptimizationProtocols,
OptimizationSpecification,
OptimizationInputSpecification,
OptimizationQCInputSpecification,
OptimizationQueryBody,
OptimizationAddBody,
)
| none | 1 | 1.054661 | 1 | |
Metaheuristics/BRKGA/CONFIGURATION.py | presmerats/Nurse-Scheduling-LP-and-Heuristics | 1 | 6623791 | config = {'chromosomeLength': 30,
'numIndividuals': 50,
'a' : 3,
'maxNumGen':20,
'eliteProp':0.3,
'mutantProp':0.15,
'inheritanceProb':0.8}
| config = {'chromosomeLength': 30,
'numIndividuals': 50,
'a' : 3,
'maxNumGen':20,
'eliteProp':0.3,
'mutantProp':0.15,
'inheritanceProb':0.8}
| none | 1 | 1.076549 | 1 | |
2019/day3-1.py | PaulWichser/adventofcode | 0 | 6623792 | #Solution for https://adventofcode.com/2019/day/3
def wireimp(filename):
with open(filename,'r') as file:
wires = {}
x=1
for line in file:
line = line.rstrip('\n')
list = line.split(',')
wires['wire%i' % x] = list
# print(len(wires))
... | #Solution for https://adventofcode.com/2019/day/3
def wireimp(filename):
with open(filename,'r') as file:
wires = {}
x=1
for line in file:
line = line.rstrip('\n')
list = line.split(',')
wires['wire%i' % x] = list
# print(len(wires))
... | en | 0.657251 | #Solution for https://adventofcode.com/2019/day/3 # print(len(wires)) #convert strings to cartesian coords # print(coords) # print(outlist) # print(outlist) | 3.445399 | 3 |
basics/requests/myHttpServer.py | lostFox/autoRunSomething | 0 | 6623793 | #! /usr/bin/env python
# -*- coding: UTF-8 -*-
__author__ = 'james'
import web
urls = (
'/', 'index'
)
app = web.application(urls, globals())
class index:
def GET(self):
return "Hello, world!"
if __name__ == "__main__": app.run()
| #! /usr/bin/env python
# -*- coding: UTF-8 -*-
__author__ = 'james'
import web
urls = (
'/', 'index'
)
app = web.application(urls, globals())
class index:
def GET(self):
return "Hello, world!"
if __name__ == "__main__": app.run()
| fr | 0.153583 | #! /usr/bin/env python # -*- coding: UTF-8 -*- | 2.614636 | 3 |
games/game_snake/snake.py | sdenisen/test | 0 | 6623794 | <reponame>sdenisen/test<filename>games/game_snake/snake.py
import random
import time
__author__ = 'sdeni'
from tkinter import Frame, Canvas, Tk
from tkinter.constants import NW, ALL
import ImageTk
from PIL import Image
class Const:
BOARD_WIDTH = 600
BOARD_HEIGHT = 600
DOT_SIZE = 20
DELAY = 300
KE... | import random
import time
__author__ = 'sdeni'
from tkinter import Frame, Canvas, Tk
from tkinter.constants import NW, ALL
import ImageTk
from PIL import Image
class Const:
BOARD_WIDTH = 600
BOARD_HEIGHT = 600
DOT_SIZE = 20
DELAY = 300
KEY_PORTAL = "g"
KEY_DOWN = "Down"
KEY_UP = "Up"
... | en | 0.730252 | # load images, # init constants/variables # init start positions of snake/apple # create objects # init key events # check collisions with border and himself | 2.715643 | 3 |
login_website/urls.py | sukumar1612/movie_stream | 0 | 6623795 | <filename>login_website/urls.py
from django.conf.urls import url
from django.urls import path,re_path
from login_website import views
app_name = 'login_website'
urlpatterns=[
path('user_login/',views.user_login,name='user_login'),
path('register/',views.register,name='register'),
path('user_logout/',views... | <filename>login_website/urls.py
from django.conf.urls import url
from django.urls import path,re_path
from login_website import views
app_name = 'login_website'
urlpatterns=[
path('user_login/',views.user_login,name='user_login'),
path('register/',views.register,name='register'),
path('user_logout/',views... | none | 1 | 1.994382 | 2 | |
survey/adapter.py | afranck64/ultimatum | 0 | 6623796 | """
Adapter
Transform available request args into known internal value
"""
from urllib.parse import urlparse, parse_qs
from collections import defaultdict
from flask import request, current_app as app
from survey.mturk import MTurk
class BaseAdapter(object):
def get_job_id(self):
raise NotImplementedError
... | """
Adapter
Transform available request args into known internal value
"""
from urllib.parse import urlparse, parse_qs
from collections import defaultdict
from flask import request, current_app as app
from survey.mturk import MTurk
class BaseAdapter(object):
def get_job_id(self):
raise NotImplementedError
... | en | 0.80395 | Adapter Transform available request args into known internal value | 2.587512 | 3 |
map_gen_2/util/vector_util.py | hamracer/Map-Generator | 9 | 6623797 | <reponame>hamracer/Map-Generator
import math
def angle(a, b):
cos_theta = dot_prod(a, b) / (length(a) * length(b))
if cos_theta > 1:
cos_theta = 1
if cos_theta < -1:
cos_theta = -1
return math.acos(cos_theta)
def dot_prod(a, b):
return a[0] * b[0] + a[1] * b[1]
def get_unit_per... | import math
def angle(a, b):
cos_theta = dot_prod(a, b) / (length(a) * length(b))
if cos_theta > 1:
cos_theta = 1
if cos_theta < -1:
cos_theta = -1
return math.acos(cos_theta)
def dot_prod(a, b):
return a[0] * b[0] + a[1] * b[1]
def get_unit_perp(a):
m_a = math.sqrt(a[0] **... | en | 0.593961 | Subtracts b from a. | 2.928638 | 3 |
join_csv.py | yetinater/Prediction-of-Steering-Angle-using-Throttle-and-Road-Angle-Values-for-Vehicle-Control | 2 | 6623798 | # script to join master_beta_csv and road_angle to prepare finaldataset file
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
def combine( df1, df2):
return pd.concat([df1, df2], axis=1, sort=False)
if __name__ == "__main__":
df1 = pd.read_csv("master_beta_csv2.csv")
df2 = pd.read_csv("roa... | # script to join master_beta_csv and road_angle to prepare finaldataset file
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
def combine( df1, df2):
return pd.concat([df1, df2], axis=1, sort=False)
if __name__ == "__main__":
df1 = pd.read_csv("master_beta_csv2.csv")
df2 = pd.read_csv("roa... | en | 0.711921 | # script to join master_beta_csv and road_angle to prepare finaldataset file | 3.081079 | 3 |
DallasPlayers/tit_for_two_tats_random_player.py | fras2560/Competition | 0 | 6623799 | <gh_stars>0
'''
@author: <NAME>
@id: 20652186
@class: CS686
@date: 2016-02-13
@note: contains a player using tit for two tats and jumping randomly at times
'''
from DallasPlayers.player import Player, DEFECT, COOPERATE
import random
class TitForTwoTatsRandomPlayer(Player):
"""
Tit for two Tats player - repeat... | '''
@author: <NAME>
@id: 20652186
@class: CS686
@date: 2016-02-13
@note: contains a player using tit for two tats and jumping randomly at times
'''
from DallasPlayers.player import Player, DEFECT, COOPERATE
import random
class TitForTwoTatsRandomPlayer(Player):
"""
Tit for two Tats player - repeat two opponen... | en | 0.761675 | @author: <NAME> @id: 20652186 @class: CS686 @date: 2016-02-13 @note: contains a player using tit for two tats and jumping randomly at times Tit for two Tats player - repeat two opponent's last choice (cheat if one cheats), jump randomly at times # repeat opponent last choice if both choose corporation # jump moves ... | 3.298111 | 3 |
Nitesh-Bhosle-:---Insurance-claim-prediction/code.py | Niteshnupur/nlp-dl-prework | 0 | 6623800 | # --------------
# Data loading and splitting
#The first step - you know the drill by now - load the dataset and see how it looks like. Additionally, split it into train and test set.
# import the libraries
import numpy as np
import pandas as pd
import seaborn as sns
from sklearn.model_selection import train_test_s... | # --------------
# Data loading and splitting
#The first step - you know the drill by now - load the dataset and see how it looks like. Additionally, split it into train and test set.
# import the libraries
import numpy as np
import pandas as pd
import seaborn as sns
from sklearn.model_selection import train_test_s... | en | 0.769892 | # -------------- # Data loading and splitting #The first step - you know the drill by now - load the dataset and see how it looks like. Additionally, split it into train and test set. # import the libraries # Code starts here # Load dataset using pandas read_csv api in variable df and give file path as path. # Displa... | 3.877106 | 4 |
bridgedata/models/gcbc_images_context.py | yanlai00/bridge_data_imitation_learning | 8 | 6623801 | import numpy as np
import pdb
import torch
import os
import torch.nn as nn
import torch.nn.functional as F
from bridgedata.utils.general_utils import AttrDict
from bridgedata.utils.general_utils import select_indices, trch2npy
from bridgedata.models.base_model import BaseModel
from bridgedata.models.utils.resnet import... | import numpy as np
import pdb
import torch
import os
import torch.nn as nn
import torch.nn.functional as F
from bridgedata.utils.general_utils import AttrDict
from bridgedata.utils.general_utils import select_indices, trch2npy
from bridgedata.models.base_model import BaseModel
from bridgedata.models.utils.resnet import... | en | 0.596231 | # override defaults with config file # add new params to parent params | 1.593491 | 2 |
process_data.py | Shiqan/VgOversight | 0 | 6623802 | <reponame>Shiqan/VgOversight
import datetime
from sqlalchemy.exc import SQLAlchemyError
from flask_app import app, db
from models import Team, Guild, Match, Roster, Participant, Player
def process_batch_query(matches):
teams = db.session.query(Team).all()
teams = [(team.id, {member.id for member in team._me... | import datetime
from sqlalchemy.exc import SQLAlchemyError
from flask_app import app, db
from models import Team, Guild, Match, Roster, Participant, Player
def process_batch_query(matches):
teams = db.session.query(Team).all()
teams = [(team.id, {member.id for member in team._members}) for team in teams]
... | none | 1 | 2.521178 | 3 | |
brinagen/__init__.py | belboo/brinagen | 0 | 6623803 | <reponame>belboo/brinagen
__all__ = ['snp_dict', 'tools']
| __all__ = ['snp_dict', 'tools'] | none | 1 | 1.105056 | 1 | |
test/create_image.py | hugs/detour | 2 | 6623804 | import Image
from PIL import Image
import ImageFont
img = Image.new("RGB", (1250, 480), (255, 255, 255))
import ImageDraw
draw = ImageDraw.Draw(img)
font = ImageFont.truetype("/System/Library/Fonts/Monaco.dfont", 20, encoding="armn")
draw.text((20, 20), "<- 10 ->" * 10, font=font, fill="black")
draw.text((20, 40), "... | import Image
from PIL import Image
import ImageFont
img = Image.new("RGB", (1250, 480), (255, 255, 255))
import ImageDraw
draw = ImageDraw.Draw(img)
font = ImageFont.truetype("/System/Library/Fonts/Monaco.dfont", 20, encoding="armn")
draw.text((20, 20), "<- 10 ->" * 10, font=font, fill="black")
draw.text((20, 40), "... | none | 1 | 3.070716 | 3 | |
main.py | hjayaweera/random_select | 0 | 6623805 | <gh_stars>0
import random
import numpy as np
import matplotlib.pyplot as plt
class File(object):
file_name="test.txt"
file_mode="r"
def __init__(self,file_name="test.txt",file_mode="r"):
self.file_name=file_name
self.file_mode=file_mode
def read_file(self):
if(self.file_mode==... | import random
import numpy as np
import matplotlib.pyplot as plt
class File(object):
file_name="test.txt"
file_mode="r"
def __init__(self,file_name="test.txt",file_mode="r"):
self.file_name=file_name
self.file_mode=file_mode
def read_file(self):
if(self.file_mode=="r"):
... | en | 0.783711 | #if list is short send everything available | 3.631441 | 4 |
docs/conf.py | vale981/cl-telegram-bot | 1 | 6623806 | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | en | 0.744343 | # Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If exte... | 1.690347 | 2 |
main.py | RainrainWu/swe-compass | 1 | 6623807 | <filename>main.py
import json
import argparse
from subprocess import call
from analyzer.planner import Planner
from config import PlannerConfig
parser = argparse.ArgumentParser()
parser.add_argument(
"--update",
"-u",
action="store_true",
help="update job description samples by scrapers",
default=... | <filename>main.py
import json
import argparse
from subprocess import call
from analyzer.planner import Planner
from config import PlannerConfig
parser = argparse.ArgumentParser()
parser.add_argument(
"--update",
"-u",
action="store_true",
help="update job description samples by scrapers",
default=... | none | 1 | 2.330787 | 2 | |
tweepy_scraper.py | cperiz/trending_hashtags | 0 | 6623808 | <reponame>cperiz/trending_hashtags<gh_stars>0
from __future__ import absolute_import, print_function
from tweepy.streaming import StreamListener
from tweepy import OAuthHandler
from tweepy import Stream
import json
import time
import os
from lib.counter import HashProcessor
from lib.counter import ReplyProcessor
from ... | from __future__ import absolute_import, print_function
from tweepy.streaming import StreamListener
from tweepy import OAuthHandler
from tweepy import Stream
import json
import time
import os
from lib.counter import HashProcessor
from lib.counter import ReplyProcessor
from lib.async_sender import Sender
"""
#: Downloa... | en | 0.749818 | #: Downloads tweets from the geobox area (set in bounding box). #: Finds most common hashtags. #: Uses rabbitMQ to asynchronously message a program that #: downloads news urls for these hashtags or prints a histogram of hashtags. # ----- Bounding boxes for geolocations ------# ## Online-Tool to create boxes (c+p as raw... | 2.764404 | 3 |
forest/test_util.py | andrewgryan/sql-playground | 0 | 6623809 | import unittest
import bokeh
import util
class TestDropdown(unittest.TestCase):
def test_on_click_sets_label(self):
dropdown = bokeh.models.Dropdown(menu=[("A", "a")])
callback = util.autolabel(dropdown)
callback("a")
self.assertEqual(dropdown.label, "A")
def test_autowarn(sel... | import unittest
import bokeh
import util
class TestDropdown(unittest.TestCase):
def test_on_click_sets_label(self):
dropdown = bokeh.models.Dropdown(menu=[("A", "a")])
callback = util.autolabel(dropdown)
callback("a")
self.assertEqual(dropdown.label, "A")
def test_autowarn(sel... | none | 1 | 2.837509 | 3 | |
blog/migrations/0001_initial.py | wisdomkhan/CRUD_Blog | 0 | 6623810 | <filename>blog/migrations/0001_initial.py
# Generated by Django 3.2 on 2021-09-22 14:35
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='AddBlog',
fields=[
... | <filename>blog/migrations/0001_initial.py
# Generated by Django 3.2 on 2021-09-22 14:35
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='AddBlog',
fields=[
... | en | 0.803838 | # Generated by Django 3.2 on 2021-09-22 14:35 | 1.89907 | 2 |
tests/test_mysql.py | dkudeki/BookwormDB | 73 | 6623811 | from builtins import hex
import unittest
import bookwormDB
from bookwormDB.configuration import Configfile
import bookwormDB.CreateDatabase
import logging
import MySQLdb
import random
logging.basicConfig(level=10)
"""
Tests of the MySQL configuration.
"""
class Bookworm_MySQL_Configuration(unittest.TestCase):
d... | from builtins import hex
import unittest
import bookwormDB
from bookwormDB.configuration import Configfile
import bookwormDB.CreateDatabase
import logging
import MySQLdb
import random
logging.basicConfig(level=10)
"""
Tests of the MySQL configuration.
"""
class Bookworm_MySQL_Configuration(unittest.TestCase):
d... | en | 0.932606 | Tests of the MySQL configuration. Connect to MySQL and run a simple query. To properly test things, we actually build some bookworms. This assumes that the directory '/tmp' is writeable, which isn't strictly necessary for a bookworm to be built. | 2.854463 | 3 |
Lesson 4-Branches/activity_step_30.py | samy-khelifa/Version-Control-with-Git-and-GitHub | 5 | 6623812 | <filename>Lesson 4-Branches/activity_step_30.py
# Activity
@classmethod
def distance(cls, unit, *args):
distance = 0
distance = reduce(lambda x, y: x*y, args)
return "%s %s" %(distance, unit)
| <filename>Lesson 4-Branches/activity_step_30.py
# Activity
@classmethod
def distance(cls, unit, *args):
distance = 0
distance = reduce(lambda x, y: x*y, args)
return "%s %s" %(distance, unit)
| en | 0.566569 | # Activity | 3.224627 | 3 |
py4j-python/src/py4j/version.py | torokati44/py4j | 0 | 6623813 | __version__ = '0.10.9.3'
| __version__ = '0.10.9.3'
| none | 1 | 1.050121 | 1 | |
pubdb_prepare.py | Archieyoung/SVAN | 7 | 6623814 | #!/usr/bin/env python3
"""
prepare SV database for annotation
convert 1000genome, DGV, dbVar SV files into bed files
"""
import sys
import gzip
import logging
import operator
import os
from glob import iglob
from datetime import date
from sv_vcf import SV
# 1000genome
class one_thousand_sv(object):
def __init__... | #!/usr/bin/env python3
"""
prepare SV database for annotation
convert 1000genome, DGV, dbVar SV files into bed files
"""
import sys
import gzip
import logging
import operator
import os
from glob import iglob
from datetime import date
from sv_vcf import SV
# 1000genome
class one_thousand_sv(object):
def __init__... | en | 0.45694 | #!/usr/bin/env python3 prepare SV database for annotation convert 1000genome, DGV, dbVar SV files into bed files # 1000genome # 1000genome vcf file parse # info dict # end # if can not find end in info, end = start(eg. insertion) # SVLEN # SVTYPE # allele frequency # multi-alleles(CNVs,0,1,2...) frequency is not consid... | 2.546576 | 3 |
codes/models/VSR_model.py | grofit/traiNNer | 78 | 6623815 | from __future__ import absolute_import
import os
import logging
from collections import OrderedDict
import torch
import torch.nn as nn
import models.networks as networks
from .base_model import BaseModel
from . import losses
from dataops.colors import ycbcr_to_rgb
import torch.nn.functional as F
from dataops.debug i... | from __future__ import absolute_import
import os
import logging
from collections import OrderedDict
import torch
import torch.nn as nn
import models.networks as networks
from .base_model import BaseModel
from . import losses
from dataops.colors import ycbcr_to_rgb
import torch.nn.functional as F
from dataops.debug i... | en | 0.606275 | # specify the models you want to load/save to the disk. # The training/test scripts will call <BaseModel.save_networks> # and <BaseModel.load_networks> # for training and testing, a generator 'G' is needed # define networks and load pretrained models # G # add discriminator to the network list # D # load G and D if nee... | 2.180042 | 2 |
tests/test_arrays.py | ritabt/petra | 0 | 6623816 | <filename>tests/test_arrays.py
from typing import cast, Callable
import subprocess
import petra as pt
import unittest
from ctypes import CFUNCTYPE, c_int32
program = pt.Program("module")
My_Array = pt.ArrayType(pt.Int32_t, 3)
array_var = pt.Symbol(My_Array, "array_var")
program.add_func(
"array_set_get_values"... | <filename>tests/test_arrays.py
from typing import cast, Callable
import subprocess
import petra as pt
import unittest
from ctypes import CFUNCTYPE, c_int32
program = pt.Program("module")
My_Array = pt.ArrayType(pt.Int32_t, 3)
array_var = pt.Symbol(My_Array, "array_var")
program.add_func(
"array_set_get_values"... | none | 1 | 2.335365 | 2 | |
output/models/nist_data/atomic/nmtoken/schema_instance/nistschema_sv_iv_atomic_nmtoken_pattern_3_xsd/nistschema_sv_iv_atomic_nmtoken_pattern_3.py | tefra/xsdata-w3c-tests | 1 | 6623817 | <gh_stars>1-10
from dataclasses import dataclass, field
__NAMESPACE__ = "NISTSchema-SV-IV-atomic-NMTOKEN-pattern-3-NS"
@dataclass
class NistschemaSvIvAtomicNmtokenPattern3:
class Meta:
name = "NISTSchema-SV-IV-atomic-NMTOKEN-pattern-3"
namespace = "NISTSchema-SV-IV-atomic-NMTOKEN-pattern-3-NS"
... | from dataclasses import dataclass, field
__NAMESPACE__ = "NISTSchema-SV-IV-atomic-NMTOKEN-pattern-3-NS"
@dataclass
class NistschemaSvIvAtomicNmtokenPattern3:
class Meta:
name = "NISTSchema-SV-IV-atomic-NMTOKEN-pattern-3"
namespace = "NISTSchema-SV-IV-atomic-NMTOKEN-pattern-3-NS"
value: str =... | none | 1 | 1.803223 | 2 | |
BPt/main/helpers.py | sahahn/ABCD_ML | 1 | 6623818 | <reponame>sahahn/ABCD_ML
def clean_str(in_str):
# If float input, want to
# represent without decimals if
# they are just 0's
if isinstance(in_str, float):
as_int_str = f'{in_str:.0f}'
if float(as_int_str) == in_str:
in_str = as_int_str
# Make sure str
in_str = str(... | def clean_str(in_str):
# If float input, want to
# represent without decimals if
# they are just 0's
if isinstance(in_str, float):
as_int_str = f'{in_str:.0f}'
if float(as_int_str) == in_str:
in_str = as_int_str
# Make sure str
in_str = str(in_str)
# Get rid of... | en | 0.895567 | # If float input, want to # represent without decimals if # they are just 0's # Make sure str # Get rid of some common repr issues | 3.472411 | 3 |
setup.py | rpappalax/box-it-up | 0 | 6623819 | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name = "box-it-up",
version = "0.0.3",
description = "Python class for formatting various kinds of table data into an ascii table.",
author = "<NAME>",
author_email = "<EMAIL>",
url = "https://github.com/rpappalax/box-it-... | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name = "box-it-up",
version = "0.0.3",
description = "Python class for formatting various kinds of table data into an ascii table.",
author = "<NAME>",
author_email = "<EMAIL>",
url = "https://github.com/rpappalax/box-it-... | ru | 0.26433 | #!/usr/bin/env python | 1.719566 | 2 |
providers/poczta.py | krzynio/pl-packagetrack | 7 | 6623820 | <filename>providers/poczta.py
#!/usr/bin/env python
import requests
import os, sys
from pyquery import PyQuery as pq
import time
import logging
import dateparser
import re
sys.path.insert(1, os.path.join(sys.path[0], '..'))
from models import trackingStatus,trackingEvent
NAME = "<NAME>"
ID = __name__[10:]
POPULARIT... | <filename>providers/poczta.py
#!/usr/bin/env python
import requests
import os, sys
from pyquery import PyQuery as pq
import time
import logging
import dateparser
import re
sys.path.insert(1, os.path.join(sys.path[0], '..'))
from models import trackingStatus,trackingEvent
NAME = "<NAME>"
ID = __name__[10:]
POPULARIT... | en | 0.287577 | #!/usr/bin/env python # International Postal Union # domestic #zadarzenia_td') | 2.412727 | 2 |
asteroid.py | penguintutor/pico-spacegame | 2 | 6623821 | import utime
from constants import *
class Asteroid:
def __init__ (self, display, start_time, image_size, start_pos, velocity, color=(150, 75, 0)):
self.display = display
if (image_size == "asteroid_sml"):
self.size = 5
elif (image_size == "asteroid_med"):
self.... | import utime
from constants import *
class Asteroid:
def __init__ (self, display, start_time, image_size, start_pos, velocity, color=(150, 75, 0)):
self.display = display
if (image_size == "asteroid_sml"):
self.size = 5
elif (image_size == "asteroid_med"):
self.... | en | 0.790236 | #self.x = start_pos[0] #self.y = start_pos[1] # start position is off screen # Check if time reached #print ("Starting new asteroid") # Reset to start position # simplified check based on rect around centre of asteroid | 3.154644 | 3 |
train_thu.py | MengyuanChen21/CVPR2022-FTCL | 2 | 6623822 | <gh_stars>1-10
from tqdm import tqdm
import numpy as np
import torch
def train(args, model, dataloader, pair_dataloader, criterion, optimizer):
model.train()
print("-------------------------------------------------------------------------------")
device = args.device
# train_process
tr... | from tqdm import tqdm
import numpy as np
import torch
def train(args, model, dataloader, pair_dataloader, criterion, optimizer):
model.train()
print("-------------------------------------------------------------------------------")
device = args.device
# train_process
train_num_correct... | en | 0.655885 | # train_process | 2.382727 | 2 |
funcao/funcao-zip.py | robertoweller/python | 0 | 6623823 | <reponame>robertoweller/python
def ziP(*iterables):
# zip('ABCD', 'xy') --> Ax By
sentinel = object()
iterators = [iter(it) for it in iterables]
while iterators:
result = []
for it in iterators:
elem = next(it, sentinel)
if elem is sentinel:
return... | def ziP(*iterables):
# zip('ABCD', 'xy') --> Ax By
sentinel = object()
iterators = [iter(it) for it in iterables]
while iterators:
result = []
for it in iterators:
elem = next(it, sentinel)
if elem is sentinel:
return
result.append(elem... | en | 0.389012 | # zip('ABCD', 'xy') --> Ax By | 4.080132 | 4 |
game_stats.py | plmanish/Alien-Invasion | 0 | 6623824 | <reponame>plmanish/Alien-Invasion
class GameStats():
"""Track statistics for Alien Invasion."""
def __init__(self, ai_settings):
"""Initialize statistics."""
self.ai_settings = ai_settings
self.reset_stats()
# Start Alien Invasion in an active state.
self.game_active = F... | class GameStats():
"""Track statistics for Alien Invasion."""
def __init__(self, ai_settings):
"""Initialize statistics."""
self.ai_settings = ai_settings
self.reset_stats()
# Start Alien Invasion in an active state.
self.game_active = False
# High score should n... | en | 0.908124 | Track statistics for Alien Invasion. Initialize statistics. # Start Alien Invasion in an active state. # High score should never be reset. Initialize statistics that can change during the game. | 3.421973 | 3 |
operbench/models/base.py | lirixiang123/oper_bench | 0 | 6623825 | <reponame>lirixiang123/oper_bench
"""
@file: base
@author: <EMAIL>
@date: 2020/03/11
@desc:
"""
from flask_sqlalchemy import SQLAlchemy
db = SQLAlchemy()
from . import cmdb
from . import user
from . import ops_tools
| """
@file: base
@author: <EMAIL>
@date: 2020/03/11
@desc:
"""
from flask_sqlalchemy import SQLAlchemy
db = SQLAlchemy()
from . import cmdb
from . import user
from . import ops_tools | en | 0.30328 | @file: base @author: <EMAIL> @date: 2020/03/11 @desc: | 1.213781 | 1 |
tests/test_all.py | kuviokelluja/DefuseZip | 0 | 6623826 | import sys
import tempfile
from pathlib import Path
from shutil import copy
import pytest
from DefuseZip.loader import DefuseZip
class Test_all:
DANGEROUS = True
SAFE = False
testdata = [
("LICENSE.zip", SAFE),
("single.zip", SAFE),
("double_nested.zip", SAFE),
("travelsa... | import sys
import tempfile
from pathlib import Path
from shutil import copy
import pytest
from DefuseZip.loader import DefuseZip
class Test_all:
DANGEROUS = True
SAFE = False
testdata = [
("LICENSE.zip", SAFE),
("single.zip", SAFE),
("double_nested.zip", SAFE),
("travelsa... | en | 0.494085 | # ,('zbxl_BAMSOFTWARE.zip', DANGEROUS) # expected value to true, because the real test on windows is NotImplementedError | 2.304082 | 2 |
Task/Non-decimal-radices-Input/Python/non-decimal-radices-input.py | mullikine/RosettaCodeData | 5 | 6623827 | <filename>Task/Non-decimal-radices-Input/Python/non-decimal-radices-input.py
>>> text = '100'
>>> for base in range(2,21):
print ("String '%s' in base %i is %i in base 10"
% (text, base, int(text, base)))
String '100' in base 2 is 4 in base 10
String '100' in base 3 is 9 in base 10
String '100' in ... | <filename>Task/Non-decimal-radices-Input/Python/non-decimal-radices-input.py
>>> text = '100'
>>> for base in range(2,21):
print ("String '%s' in base %i is %i in base 10"
% (text, base, int(text, base)))
String '100' in base 2 is 4 in base 10
String '100' in base 3 is 9 in base 10
String '100' in ... | none | 1 | 3.760882 | 4 | |
stubs.min/System/Diagnostics/__init___parts/PresentationTraceSources.py | ricardyn/ironpython-stubs | 1 | 6623828 | class PresentationTraceSources(object):
""" Provides debug tracing support that is specifically targeted for Windows Presentation Foundation (WPF) applications. """
@staticmethod
def GetTraceLevel(element):
"""
GetTraceLevel(element: object) -> PresentationTraceLevel
Gets the value of the System.D... | class PresentationTraceSources(object):
""" Provides debug tracing support that is specifically targeted for Windows Presentation Foundation (WPF) applications. """
@staticmethod
def GetTraceLevel(element):
"""
GetTraceLevel(element: object) -> PresentationTraceLevel
Gets the value of the System.D... | en | 0.662457 | Provides debug tracing support that is specifically targeted for Windows Presentation Foundation (WPF) applications. GetTraceLevel(element: object) -> PresentationTraceLevel
Gets the value of the System.Diagnostics.PresentationTraceSources.TraceLevel�
attached property for a specified element.
... | 1.940104 | 2 |
capture/cf/server.py | JohnDMcMaster/pr0ntools | 38 | 6623829 | <filename>capture/cf/server.py
#!/usr/bin/python
'''
For now this has very narrow focus of taking in a directory, serving it, and then terminating
Eventually this should become a service that can register projects in different directories
Do not assume that the two computers have any connection between them other than... | <filename>capture/cf/server.py
#!/usr/bin/python
'''
For now this has very narrow focus of taking in a directory, serving it, and then terminating
Eventually this should become a service that can register projects in different directories
Do not assume that the two computers have any connection between them other than... | en | 0.927522 | #!/usr/bin/python For now this has very narrow focus of taking in a directory, serving it, and then terminating Eventually this should become a service that can register projects in different directories Do not assume that the two computers have any connection between them other than the socket -Do not share file path... | 2.639213 | 3 |
scripts/ExtractBagFile/ReadBagExtended.py | Wuselwog/bus-stop-detection | 0 | 6623830 | <gh_stars>0
# -*- coding: utf-8 -*-
"""
Extract images and GPS from a rosbag.
"""
import os
from os.path import isfile, join
import argparse
import cv2
import rosbag, rospy
from sensor_msgs.msg import Image, NavSatFix
from cv_bridge import CvBridge
from exif import set_gps_location
def write_images(img_buffer, arg... | # -*- coding: utf-8 -*-
"""
Extract images and GPS from a rosbag.
"""
import os
from os.path import isfile, join
import argparse
import cv2
import rosbag, rospy
from sensor_msgs.msg import Image, NavSatFix
from cv_bridge import CvBridge
from exif import set_gps_location
def write_images(img_buffer, args):
for ... | en | 0.399337 | # -*- coding: utf-8 -*- Extract images and GPS from a rosbag. # img_buffer.append(image_dir, cv_img, LAST_GPS) # latitude, longitude and width in degrees of break areas # washington_pause_loc = [40.172611, -80.244531] #parser.add_argument( # "-i", "--input", default='./test.bag', help="Input ROS bag") # parser.add_a... | 2.851255 | 3 |
msg.py | takamitsu-iida/webex-teams-practice-2 | 0 | 6623831 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# pylint: disable=missing-docstring
import json
import logging
import os
import sys
from jinja2 import Environment, FileSystemLoader
import redis
import requests
requests.packages.urllib3.disable_warnings()
logger = logging.getLogger(__name__)
def here(path=''):
re... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# pylint: disable=missing-docstring
import json
import logging
import os
import sys
from jinja2 import Environment, FileSystemLoader
import redis
import requests
requests.packages.urllib3.disable_warnings()
logger = logging.getLogger(__name__)
def here(path=''):
re... | en | 0.460032 | #!/usr/bin/env python3 # -*- coding: utf-8 -*- # pylint: disable=missing-docstring # name and directory path of this application # print(json.dumps(send_result, ensure_ascii=False, indent=2)) # store as hash # time to live is 10 min # show keys in db # show values in db get weather information as json data. http://w... | 1.981457 | 2 |
FeatureServer/DataSource/Twitter.py | AstunTechnology/featureserver | 55 | 6623832 | <reponame>AstunTechnology/featureserver<gh_stars>10-100
from FeatureServer.DataSource import DataSource
from vectorformats.Feature import Feature
from FeatureServer.Exceptions.NoGeometryException import NoGeometryException
import oauth2 as oauth
import urllib
import urlparse
import simplejson
import math
class Twitt... | from FeatureServer.DataSource import DataSource
from vectorformats.Feature import Feature
from FeatureServer.Exceptions.NoGeometryException import NoGeometryException
import oauth2 as oauth
import urllib
import urlparse
import simplejson
import math
class Twitter (DataSource):
api = None
geo_keys = ['coordi... | en | 0.495402 | # latitude, longitude # geo field is deprecated. Should be removed | 2.917656 | 3 |
nsniff/widget.py | matham/nsniff | 0 | 6623833 | import numpy as np
from typing import List, Dict, Optional, Tuple
from matplotlib import cm
from kivy_trio.to_trio import kivy_run_in_async, mark, KivyEventCancelled
from pymoa_remote.threading import ThreadExecutor
from base_kivy_app.app import app_error
from kivy_garden.graph import Graph, ContourPlot, LinePlot
from... | import numpy as np
from typing import List, Dict, Optional, Tuple
from matplotlib import cm
from kivy_trio.to_trio import kivy_run_in_async, mark, KivyEventCancelled
from pymoa_remote.threading import ThreadExecutor
from base_kivy_app.app import app_error
from kivy_garden.graph import Graph, ContourPlot, LinePlot
from... | en | 0.816254 | # reduce to scalar # min val will be 1 (log 1 == 0) | 1.934966 | 2 |
practical-penguins/trivia_tavern/trivia_runner/models.py | Vthechamp22/summer-code-jam-2021 | 40 | 6623834 | import random
import string
from django.contrib.auth.models import User
from django.db import models
from django.utils import timezone
from trivia_builder.models import TriviaQuiz, TriviaQuestion
from phonenumber_field.modelfields import PhoneNumberField
class Player(models.Model):
team_name = models.CharField(... | import random
import string
from django.contrib.auth.models import User
from django.db import models
from django.utils import timezone
from trivia_builder.models import TriviaQuiz, TriviaQuestion
from phonenumber_field.modelfields import PhoneNumberField
class Player(models.Model):
team_name = models.CharField(... | en | 0.737439 | # Model name needs to be in quotes according to # https://docs.djangoproject.com/en/3.0/ref/models/fields/#foreignkey #:{self.current_question_index} ' | 2.646549 | 3 |
unittests/configloaders/test_json_schema_validation.py | ONS-OpenData/gss-utils | 0 | 6623835 | <gh_stars>0
import json
from gssutils.csvcubedintegration.configloaders.jsonschemavalidation import (
validate_dict_against_schema_url,
)
def test_json_schema_validation_passes():
value: dict = json.loads(
"""
{
"id": "some-id",
"published": "2020-01-01",
"... | import json
from gssutils.csvcubedintegration.configloaders.jsonschemavalidation import (
validate_dict_against_schema_url,
)
def test_json_schema_validation_passes():
value: dict = json.loads(
"""
{
"id": "some-id",
"published": "2020-01-01",
"landingPage"... | en | 0.632064 | { "id": "some-id", "published": "2020-01-01", "landingPage": "http://example.com/landing-page", "title" : "some title", "description" : "some description", "publisher" : "some publisher", "families" : ["some family"] } { ... | 2.75659 | 3 |
question_classifier.py | Night0mistery/Knowledged_QA | 0 | 6623836 | <reponame>Night0mistery/Knowledged_QA
#!/usr/bin/env python3
# coding: utf-8
import os
import ahocorasick
from src.redis_helper import RedisHelper
from src.tireTree import Trie
from src.KeywordProcessor import KeywordProcessor
import copy
from backinfo import BackInfo
class QuestionClassifier:
def __init__(self... | #!/usr/bin/env python3
# coding: utf-8
import os
import ahocorasick
from src.redis_helper import RedisHelper
from src.tireTree import Trie
from src.KeywordProcessor import KeywordProcessor
import copy
from backinfo import BackInfo
class QuestionClassifier:
def __init__(self, entities, qwds_dict, question_judge_... | en | 0.260549 | #!/usr/bin/env python3 # coding: utf-8 # redis # 特征词路径 # 加载特征词,根据特征词确定实体 # 目前有疾病、科室、药品、实物、并发症、诊断检查项目、在售药品 # 构建字典树 # self.region_tree = self.build_actree(list(self.region_words)) # 构建词典 词:类型 # 问句疑问词 # self.qwds_type = list(qwds_dict.keys()) # 构建关键词 # TODO 问答类型这一部分可以用flashtext加快查找速度 # question_type = 'others' # 无实体有问题类... | 2.307956 | 2 |
test/augmentation/test_torchaudio.py | cnheider/lhotse | 0 | 6623837 | import math
import pytest
import torch
torchaudio = pytest.importorskip('torchaudio', minversion='0.6')
from lhotse.augmentation import SoxEffectTransform, pitch, reverb, speed
SAMPLING_RATE = 16000
@pytest.fixture
def audio():
return torch.sin(2 * math.pi * torch.linspace(0, 1, 16000)).unsqueeze(0).numpy()
... | import math
import pytest
import torch
torchaudio = pytest.importorskip('torchaudio', minversion='0.6')
from lhotse.augmentation import SoxEffectTransform, pitch, reverb, speed
SAMPLING_RATE = 16000
@pytest.fixture
def audio():
return torch.sin(2 * math.pi * torch.linspace(0, 1, 16000)).unsqueeze(0).numpy()
... | en | 0.848424 | # Since speed() is not deterministic and between 0.9x - 1.1x, multiple invocations # will yield either slower (more samples) or faster (less samples) signal. # The truncation/padding is performed inside of SoxEffectTransform so the user should not # see these changes. | 2.514395 | 3 |
py-data/salmon/problems/api-related/1/correct-usages/Command.py | ualberta-smr/NFBugs | 3 | 6623838 | <filename>py-data/salmon/problems/api-related/1/correct-usages/Command.py
import json
import subprocess
from optparse import make_option
import yaml
from django.conf import settings
from django.core.management.base import BaseCommand
from django.utils import timezone
from salmon.apps.monitor import models, utils
cla... | <filename>py-data/salmon/problems/api-related/1/correct-usages/Command.py
import json
import subprocess
from optparse import make_option
import yaml
from django.conf import settings
from django.core.management.base import BaseCommand
from django.utils import timezone
from salmon.apps.monitor import models, utils
cla... | none | 1 | 1.924746 | 2 | |
src/orco_bot/tasks/delete_branch.py | openforceit/oca-github-bot | 1 | 6623839 | # Copyright (c) <NAME>/NV 2018
# Distributed under the MIT License (http://opensource.org/licenses/MIT).
import re
from .. import github
from ..config import switchable
from ..github import gh_call
from ..queue import getLogger, task
_logger = getLogger(__name__)
TEST_BRANCH_REGEX = '^[0-9][0-9]?\.[0-9]-test(ing)?$... | # Copyright (c) <NAME>/NV 2018
# Distributed under the MIT License (http://opensource.org/licenses/MIT).
import re
from .. import github
from ..config import switchable
from ..github import gh_call
from ..queue import getLogger, task
_logger = getLogger(__name__)
TEST_BRANCH_REGEX = '^[0-9][0-9]?\.[0-9]-test(ing)?$... | en | 0.710522 | # Copyright (c) <NAME>/NV 2018 # Distributed under the MIT License (http://opensource.org/licenses/MIT). | 2.297283 | 2 |
backend/reinforcepy/agent/q_learning.py | DerekDick/reinforce-py | 1 | 6623840 | # Copyright 2020 <NAME> <<EMAIL>>
# 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 by applicable law... | # Copyright 2020 <NAME> <<EMAIL>>
# 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 by applicable law... | en | 0.781042 | # Copyright 2020 <NAME> <<EMAIL>> # 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 by applicable law o... | 2.444518 | 2 |
src/package/constants.py | Y-oHr-N/m5-forecasting | 2 | 6623841 | import pathlib
from .utils import *
module_path = pathlib.Path(__file__)
package_dir_path = module_path.parent
src_dir_path = package_dir_path.parent
root_dir_path = src_dir_path.parent
data_dir_path = root_dir_path / "data"
raw_dir_path = data_dir_path / "raw"
calendar_path = raw_dir_path / "calendar.csv"
sales_tr... | import pathlib
from .utils import *
module_path = pathlib.Path(__file__)
package_dir_path = module_path.parent
src_dir_path = package_dir_path.parent
root_dir_path = src_dir_path.parent
data_dir_path = root_dir_path / "data"
raw_dir_path = data_dir_path / "raw"
calendar_path = raw_dir_path / "calendar.csv"
sales_tr... | ko | 0.269876 | # { # "event_name": "ChineseNewYear", # "event_type": "Religious", # "dates": [ # "2011-02-03", # "2012-01-23", # "2013-02-10", # "2014-01-31", # "2015-02-19", # "2016-02-08", # ], # }, # { # "event_name": "NBAFinals", # "event_type": "Sporting", #... | 1.85367 | 2 |
jinja2_loader.py | jecki/SchnelleSeite | 1 | 6623842 | """jinja2_loader.py -- loader for jinja2 templates
Copyright 2015 by <NAME>
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 appl... | """jinja2_loader.py -- loader for jinja2 templates
Copyright 2015 by <NAME>
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 appl... | en | 0.610142 | jinja2_loader.py -- loader for jinja2 templates Copyright 2015 by <NAME> 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 applica... | 2.498237 | 2 |
petitions/profanity.py | sosumi/IowaIdeas | 15 | 6623843 | <filename>petitions/profanity.py<gh_stars>10-100
"""
Provides functionality to see if a petition contains profanities.
Author: <NAME>
"""
import csv
import os
import re
def load_words(filename):
"""
Loads words from csv to list
"""
words = []
dirname = os.path.dirname(__file__)
csvfile = open... | <filename>petitions/profanity.py<gh_stars>10-100
"""
Provides functionality to see if a petition contains profanities.
Author: <NAME>
"""
import csv
import os
import re
def load_words(filename):
"""
Loads words from csv to list
"""
words = []
dirname = os.path.dirname(__file__)
csvfile = open... | en | 0.845572 | Provides functionality to see if a petition contains profanities. Author: <NAME> Loads words from csv to list | 3.540835 | 4 |
workspace/module/python-2.7/LxData/datCfg.py | no7hings/Lynxi | 2 | 6623844 | <reponame>no7hings/Lynxi
# coding:utf-8
import os
import copy
class DatUtility(object):
MOD_os = os
MOD_copy = copy
DEF_dat__datatype_pathsep = u'/'
DEF_dat__node_namespace_pathsep = u':'
DEF_dat__node_type_pathsep = u'/'
DEF_dat__node_pathsep = u'/'
DEF_dat__node_port_pathsep = u'.'
... | # coding:utf-8
import os
import copy
class DatUtility(object):
MOD_os = os
MOD_copy = copy
DEF_dat__datatype_pathsep = u'/'
DEF_dat__node_namespace_pathsep = u':'
DEF_dat__node_type_pathsep = u'/'
DEF_dat__node_pathsep = u'/'
DEF_dat__node_port_pathsep = u'.'
DEF_dat__node_variant_... | en | 0.786515 | # coding:utf-8 | 2.00684 | 2 |
ltable.py | LionCoder4ever/pylua | 0 | 6623845 | <reponame>LionCoder4ever/pylua<filename>ltable.py
import collections
from lmath import FloatToInteger
from lvalue import LuaValue, LUATYPE, LuaNil
class LuaDict(collections.Mapping):
def __init__(self):
self.map = {}
def __setitem__(self, key, value):
if not isinstance(key, LuaValue):
... | import collections
from lmath import FloatToInteger
from lvalue import LuaValue, LUATYPE, LuaNil
class LuaDict(collections.Mapping):
def __init__(self):
self.map = {}
def __setitem__(self, key, value):
if not isinstance(key, LuaValue):
raise TypeError('key must be instance of Lua... | en | 0.521291 | if key is int or can be convert to int,get value from array :param key: :return: if key is float,try convert to int :param key: :return: move item in map to arr :return: | 2.507551 | 3 |
queue_/queue_stack_test.py | MilanaShhanukova/programming-2021-19fpl | 0 | 6623846 | <filename>queue_/queue_stack_test.py
"""
Programming for linguists
Tests for Queue class.
"""
import unittest
from queue_.queue_stack import QueueStack
class QueueStackTestCase(unittest.TestCase):
"""
This Case of tests checks the functionality of the implementation of Queue
"""
def test_new_queue... | <filename>queue_/queue_stack_test.py
"""
Programming for linguists
Tests for Queue class.
"""
import unittest
from queue_.queue_stack import QueueStack
class QueueStackTestCase(unittest.TestCase):
"""
This Case of tests checks the functionality of the implementation of Queue
"""
def test_new_queue... | en | 0.874276 | Programming for linguists Tests for Queue class. This Case of tests checks the functionality of the implementation of Queue Create an empty QueueStack. Test that its size is 0. Get an element from a queue_stack. Test that it is 1. Create a QueueStack from an iterable object. Check that the size... | 3.947501 | 4 |
pycrest/test/private/test_cffi.py | Andlon/crest | 0 | 6623847 | from numpy.testing import assert_array_almost_equal
from numpy.testing import assert_array_equal
from pycrest.mesh import Mesh2d
from pycrest.private.cffi import _mesh_to_flat_mesh_data, _flat_mesh_data_to_mesh
def test_mesh_flat_data_roundtrip():
vertices = [
(0.0, 0.0),
(1.0, 0.0),
(1.0... | from numpy.testing import assert_array_almost_equal
from numpy.testing import assert_array_equal
from pycrest.mesh import Mesh2d
from pycrest.private.cffi import _mesh_to_flat_mesh_data, _flat_mesh_data_to_mesh
def test_mesh_flat_data_roundtrip():
vertices = [
(0.0, 0.0),
(1.0, 0.0),
(1.0... | none | 1 | 2.379604 | 2 | |
shipStation/Test_ServoControl.py | LBCC-SpaceClub/HAB2017 | 3 | 6623848 | <filename>shipStation/Test_ServoControl.py<gh_stars>1-10
import unittest
import ServoControl
class Test_ServoControl(unittest.TestCase):
def test_bearing(self):
aLat = 44.564939
aLon = -123.241243
bLat = 44.565973
bLon = -123.239418
new_bearing = ServoControl.bearing(a... | <filename>shipStation/Test_ServoControl.py<gh_stars>1-10
import unittest
import ServoControl
class Test_ServoControl(unittest.TestCase):
def test_bearing(self):
aLat = 44.564939
aLon = -123.241243
bLat = 44.565973
bLon = -123.239418
new_bearing = ServoControl.bearing(a... | none | 1 | 3.0546 | 3 | |
ExceptionHandlingElseFinally.py | EdgarVallejo96/pyEdureka | 0 | 6623849 | <filename>ExceptionHandlingElseFinally.py
# The else Clause
# try: run this code
# except: execute this code when there is an exception
# else: no exceptions? run this code
try:
# a = 0 / 0 # Try this
a = 10
except AssertionError as error:
print(error)
else:
print('Executing the else clause')
try:
... | <filename>ExceptionHandlingElseFinally.py
# The else Clause
# try: run this code
# except: execute this code when there is an exception
# else: no exceptions? run this code
try:
# a = 0 / 0 # Try this
a = 10
except AssertionError as error:
print(error)
else:
print('Executing the else clause')
try:
... | en | 0.878762 | # The else Clause # try: run this code # except: execute this code when there is an exception # else: no exceptions? run this code # a = 0 / 0 # Try this # SUMMARY # raise: allows you to throw an exception at any time # assert: enables you to verify if a certain condition is met and throw an exception if it isn't # try... | 3.934359 | 4 |
src/sorting/__main__.py | haihala/pvl-algot2021 | 0 | 6623850 | <gh_stars>0
from sys import argv as command_line_args
from tabulate import tabulate
from bogo import bogo_benchmark, test_bogo
from stalin import stalin_benchmark, test_stalin
from bubble import bubble_benchmark, test_bubble
from insertion import insertion_benchmark, test_insertion
from quick import quick_benchmark, ... | from sys import argv as command_line_args
from tabulate import tabulate
from bogo import bogo_benchmark, test_bogo
from stalin import stalin_benchmark, test_stalin
from bubble import bubble_benchmark, test_bubble
from insertion import insertion_benchmark, test_insertion
from quick import quick_benchmark, test_quick
f... | none | 1 | 2.605301 | 3 |