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
1094 EXPERIENCIAS.py
castrolimoeiro/Uri-exercise
0
4100
n = int(input()) coelho = rato = sapo = contador = 0 for i in range(0, n): q, t = input().split(' ') t = t.upper() q = int(q) if 1 <= q <= 15: contador += q if t == 'C': coelho += q elif t == 'R': rato += q elif t == 'S': sapo += q po...
n = int(input()) coelho = rato = sapo = contador = 0 for i in range(0, n): q, t = input().split(' ') t = t.upper() q = int(q) if 1 <= q <= 15: contador += q if t == 'C': coelho += q elif t == 'R': rato += q elif t == 'S': sapo += q po...
none
1
3.387778
3
gravur/common/amountinput.py
F483/gravur
3
4101
<gh_stars>1-10 # coding: utf-8 # Copyright (c) 2015 <NAME> <<EMAIL>> # License: MIT (see LICENSE file) from kivy.uix.boxlayout import BoxLayout from gravur.common.labelbox import LabelBox # NOQA from gravur.utils import load_widget @load_widget class AmountInput(BoxLayout): pass
# coding: utf-8 # Copyright (c) 2015 <NAME> <<EMAIL>> # License: MIT (see LICENSE file) from kivy.uix.boxlayout import BoxLayout from gravur.common.labelbox import LabelBox # NOQA from gravur.utils import load_widget @load_widget class AmountInput(BoxLayout): pass
en
0.557562
# coding: utf-8 # Copyright (c) 2015 <NAME> <<EMAIL>> # License: MIT (see LICENSE file) # NOQA
1.426143
1
tibanna/top.py
4dn-dcic/tibanna
62
4102
<filename>tibanna/top.py<gh_stars>10-100 import datetime class Top(object): """class TopSeries stores the information of a series of top commands :: echo -n 'Timestamp: '; date +%F-%H:%M:%S top -b -n1 [-i] [-c] over short intervals to monitor the same set of processes over time. An...
<filename>tibanna/top.py<gh_stars>10-100 import datetime class Top(object): """class TopSeries stores the information of a series of top commands :: echo -n 'Timestamp: '; date +%F-%H:%M:%S top -b -n1 [-i] [-c] over short intervals to monitor the same set of processes over time. An...
en
0.834806
class TopSeries stores the information of a series of top commands :: echo -n 'Timestamp: '; date +%F-%H:%M:%S top -b -n1 [-i] [-c] over short intervals to monitor the same set of processes over time. An example input content looks like below, or a series of these. The initialization...
2.844248
3
venv/Lib/site-packages/zmq/tests/test_draft.py
ajayiagbebaku/NFL-Model
603
4103
# -*- coding: utf8 -*- # Copyright (C) PyZMQ Developers # Distributed under the terms of the Modified BSD License. import os import platform import time import pytest import zmq from zmq.tests import BaseZMQTestCase, skip_pypy class TestDraftSockets(BaseZMQTestCase): def setUp(self): if not zmq.DRAFT_AP...
# -*- coding: utf8 -*- # Copyright (C) PyZMQ Developers # Distributed under the terms of the Modified BSD License. import os import platform import time import pytest import zmq from zmq.tests import BaseZMQTestCase, skip_pypy class TestDraftSockets(BaseZMQTestCase): def setUp(self): if not zmq.DRAFT_AP...
en
0.748691
# -*- coding: utf8 -*- # Copyright (C) PyZMQ Developers # Distributed under the terms of the Modified BSD License. # assert that we got *something*
2.209348
2
home/push/mipush/APIError.py
he0119/smart-home
0
4104
class APIError(Exception): """ raise APIError if receiving json message indicating failure. """ def __init__(self, error_code, error, request): self.error_code = error_code self.error = error self.request = request Exception.__init__(self, error) def __str__(self): ...
class APIError(Exception): """ raise APIError if receiving json message indicating failure. """ def __init__(self, error_code, error, request): self.error_code = error_code self.error = error self.request = request Exception.__init__(self, error) def __str__(self): ...
en
0.392843
raise APIError if receiving json message indicating failure.
3.358448
3
pythonlibs/mantis/templates/webapp/src/webapp/base.py
adoggie/Tibet.6
22
4105
<filename>pythonlibs/mantis/templates/webapp/src/webapp/base.py #coding:utf-8 class SystemDeviceType(object): InnerBox = 1 # 主屏分离的室内主机 InnerScreen = 2 # 主屏分离的室内屏 OuterBox = 3 # 室外机 PropCallApp = 4 # 物业值守 PropSentryApp = 5 # 物业岗亭机 Others = 10 ValidatedList = (1,2,3,4...
<filename>pythonlibs/mantis/templates/webapp/src/webapp/base.py #coding:utf-8 class SystemDeviceType(object): InnerBox = 1 # 主屏分离的室内主机 InnerScreen = 2 # 主屏分离的室内屏 OuterBox = 3 # 室外机 PropCallApp = 4 # 物业值守 PropSentryApp = 5 # 物业岗亭机 Others = 10 ValidatedList = (1,2,3,4...
zh
0.786513
#coding:utf-8 # 主屏分离的室内主机 # 主屏分离的室内屏 # 室外机 # 物业值守 # 物业岗亭机
1.643119
2
base/site-packages/django_qbe/urls.py
edisonlz/fastor
285
4106
<filename>base/site-packages/django_qbe/urls.py # -*- coding: utf-8 -*- from django.conf.urls.defaults import patterns, url from django_qbe.exports import formats urlpatterns = patterns('django_qbe.views', url(r'^$', 'qbe_form', name="qbe_form"), url(r'^js/$', 'qbe_js', name="qbe_js"), url(r'^results/bookm...
<filename>base/site-packages/django_qbe/urls.py # -*- coding: utf-8 -*- from django.conf.urls.defaults import patterns, url from django_qbe.exports import formats urlpatterns = patterns('django_qbe.views', url(r'^$', 'qbe_form', name="qbe_form"), url(r'^js/$', 'qbe_js', name="qbe_js"), url(r'^results/bookm...
en
0.769321
# -*- coding: utf-8 -*-
1.741102
2
augment.py
docongminh/Text-Image-Augmentation-python
217
4107
# -*- coding:utf-8 -*- # Author: RubanSeven # import cv2 import numpy as np # from transform import get_perspective_transform, warp_perspective from warp_mls import WarpMLS def distort(src, segment): img_h, img_w = src.shape[:2] cut = img_w // segment thresh = cut // 3 # thresh = img_h...
# -*- coding:utf-8 -*- # Author: RubanSeven # import cv2 import numpy as np # from transform import get_perspective_transform, warp_perspective from warp_mls import WarpMLS def distort(src, segment): img_h, img_w = src.shape[:2] cut = img_w // segment thresh = cut // 3 # thresh = img_h...
en
0.222278
# -*- coding:utf-8 -*- # Author: RubanSeven # import cv2 # from transform import get_perspective_transform, warp_perspective # thresh = img_h // segment // 3 # thresh = img_h // 5 # thresh = img_h // segment // 3 # thresh = img_h // 5 # def distort(src, segment): # img_h, img_w = src.shape[:2] # dst = np.zeros_...
2.341092
2
Graph/print all paths from two vertices in a directed graph.py
ikaushikpal/DS-450-python
3
4108
from collections import defaultdict class Graph: def __init__(self): self.graph = defaultdict(list) def addEdge(self, starting_vertex, end_vertex): self.graph[starting_vertex].append(end_vertex) def printAllPaths(self, starting_vertex, target_vertex): visitedVertices = defaultdic...
from collections import defaultdict class Graph: def __init__(self): self.graph = defaultdict(list) def addEdge(self, starting_vertex, end_vertex): self.graph[starting_vertex].append(end_vertex) def printAllPaths(self, starting_vertex, target_vertex): visitedVertices = defaultdic...
none
1
3.566556
4
tests/pipegeojson_test/test_pipegeojson.py
kamyarrasta/berrl
1
4109
# testing the output of pipegeojson against different input types import berrl as bl import itertools # making line with csv file location line1=bl.make_line('csvs/line_example.csv') # making line with list testlist=bl.read('csvs/line_example.csv') line2=bl.make_line(testlist,list=True) # testing each line geojson ...
# testing the output of pipegeojson against different input types import berrl as bl import itertools # making line with csv file location line1=bl.make_line('csvs/line_example.csv') # making line with list testlist=bl.read('csvs/line_example.csv') line2=bl.make_line(testlist,list=True) # testing each line geojson ...
en
0.905295
# testing the output of pipegeojson against different input types # making line with csv file location # making line with list # testing each line geojson against each other # carrying the passing of status down to the test for the rest # making points with csv file location # making points with list # testing each poi...
3.153378
3
tierpsy/debugging/catch_infinite_loop.py
mgh17/tierpsy-tracker
9
4110
<filename>tierpsy/debugging/catch_infinite_loop.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon May 8 16:19:07 2017 @author: ajaver """ import os import cv2 import sys import glob import threading from functools import partial main_dir = '/Volumes/behavgenom_archive$/Celine/raw/' fnames = glob.g...
<filename>tierpsy/debugging/catch_infinite_loop.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon May 8 16:19:07 2017 @author: ajaver """ import os import cv2 import sys import glob import threading from functools import partial main_dir = '/Volumes/behavgenom_archive$/Celine/raw/' fnames = glob.g...
en
0.525824
#!/usr/bin/env python3 # -*- coding: utf-8 -*- Created on Mon May 8 16:19:07 2017 @author: ajaver
2.157613
2
devito/passes/iet/languages/C.py
guaacoelho/devito
199
4111
from devito.ir import Call from devito.passes.iet.definitions import DataManager from devito.passes.iet.langbase import LangBB __all__ = ['CBB', 'CDataManager'] class CBB(LangBB): mapper = { 'aligned': lambda i: '__attribute__((aligned(%d)))' % i, 'host-alloc': lambda i, j, k: ...
from devito.ir import Call from devito.passes.iet.definitions import DataManager from devito.passes.iet.langbase import LangBB __all__ = ['CBB', 'CDataManager'] class CBB(LangBB): mapper = { 'aligned': lambda i: '__attribute__((aligned(%d)))' % i, 'host-alloc': lambda i, j, k: ...
none
1
1.893694
2
tests/_test_image.py
Freakwill/ell
0
4112
#!/usr/bin/env python3 """Test methods about image process Make sure the existance of the images """ from ell import * import numpy as np _filter = Filter.from_name('db4') def test_resize(): chennal=0 c = ImageRGB.open('src/lenna.jpg') d=c.resize(minInd=(-100,-100), maxInd=(100,100)) d.to_image() ...
#!/usr/bin/env python3 """Test methods about image process Make sure the existance of the images """ from ell import * import numpy as np _filter = Filter.from_name('db4') def test_resize(): chennal=0 c = ImageRGB.open('src/lenna.jpg') d=c.resize(minInd=(-100,-100), maxInd=(100,100)) d.to_image() ...
en
0.320585
#!/usr/bin/env python3 Test methods about image process Make sure the existance of the images # print(f"{d:i}, {d.shape}") # return (im @ h1.tensor(h2).H).P @ h1.tensor(h2)
2.463663
2
donkeycar/parts/pytorch/torch_data.py
adricl/donkeycar
1,100
4113
# PyTorch import torch from torch.utils.data import IterableDataset, DataLoader from donkeycar.utils import train_test_split from donkeycar.parts.tub_v2 import Tub from torchvision import transforms from typing import List, Any from donkeycar.pipeline.types import TubRecord, TubDataset from donkeycar.pipeline.sequence ...
# PyTorch import torch from torch.utils.data import IterableDataset, DataLoader from donkeycar.utils import train_test_split from donkeycar.parts.tub_v2 import Tub from torchvision import transforms from typing import List, Any from donkeycar.pipeline.types import TubRecord, TubDataset from donkeycar.pipeline.sequence ...
en
0.791088
# PyTorch Creates a default transform to work with torchvision models Video transform: All pre-trained models expect input images normalized in the same way, i.e. mini-batches of 3-channel RGB videos of shape (3 x T x H x W), where H and W are expected to be 112, and T is a number of video frames ...
2.760616
3
lite/__init__.py
CleverInsight/sparx-lite
0
4114
import os from tornado.template import Template __SNIPPET__ = os.path.join(os.path.dirname(os.path.abspath(__file__)), '_snippet') def T(name, **kw): t = Template(open(os.path.join(__SNIPPET__, name + '.html'), 'rb').read()) return t.generate(**dict([('template_file', name)] + globals().items() + kw.items()))
import os from tornado.template import Template __SNIPPET__ = os.path.join(os.path.dirname(os.path.abspath(__file__)), '_snippet') def T(name, **kw): t = Template(open(os.path.join(__SNIPPET__, name + '.html'), 'rb').read()) return t.generate(**dict([('template_file', name)] + globals().items() + kw.items()))
none
1
2.497001
2
homeassistant/components/sensor/hddtemp.py
mdonoughe/home-assistant
2
4115
""" Support for getting the disk temperature of a host. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.hddtemp/ """ import logging from datetime import timedelta from telnetlib import Telnet import voluptuous as vol import homeassistant.helpers....
""" Support for getting the disk temperature of a host. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.hddtemp/ """ import logging from datetime import timedelta from telnetlib import Telnet import voluptuous as vol import homeassistant.helpers....
en
0.76633
Support for getting the disk temperature of a host. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.hddtemp/ Set up the HDDTemp sensor. Representation of a HDDTemp sensor. Initialize a HDDTemp sensor. Return the name of the sensor. Return the state...
2.719966
3
boomer.py
JohnnySn0w/BabbleBot
1
4116
<reponame>JohnnySn0w/BabbleBot import random prefix = [ 'Look at you! ', 'Bless ', 'Bless! ', 'I heard about that! ', 'Amen!', 'You and the kids doing alright?', 'Miss ya\'ll!' ] suffix = [ '. Amen!', '. God bless america', '. God bless!', ' haha', '. love ya!', '. love ya\'ll!', ] def add_pre_suf(sentence): if ...
import random prefix = [ 'Look at you! ', 'Bless ', 'Bless! ', 'I heard about that! ', 'Amen!', 'You and the kids doing alright?', 'Miss ya\'ll!' ] suffix = [ '. Amen!', '. God bless america', '. God bless!', ' haha', '. love ya!', '. love ya\'ll!', ] def add_pre_suf(sentence): if random.randint(1,10) <= 6: ...
none
1
3.284197
3
bot/views.py
eyobofficial/COVID-19-Mutual-Aid
0
4117
import telegram from django.conf import settings from django.shortcuts import redirect from django.utils.decorators import method_decorator from django.views.generic import View from django.views.decorators.csrf import csrf_exempt from braces.views import CsrfExemptMixin from rest_framework.authentication import Bas...
import telegram from django.conf import settings from django.shortcuts import redirect from django.utils.decorators import method_decorator from django.views.generic import View from django.views.decorators.csrf import csrf_exempt from braces.views import CsrfExemptMixin from rest_framework.authentication import Bas...
none
1
1.919679
2
code/counterfactual_generative_networks-main/imagenet/train_cgn.py
dummyxyz1/re_counterfactual_generative
0
4118
import os from datetime import datetime from os.path import join import pathlib from tqdm import tqdm import argparse import torch from torch import nn, optim from torch.autograd import Variable import torchvision from torchvision.transforms import Pad from torchvision.utils import make_grid import repackage repackage...
import os from datetime import datetime from os.path import join import pathlib from tqdm import tqdm import argparse import torch from torch import nn, optim from torch.autograd import Variable import torchvision from torchvision.transforms import Pad from torchvision.utils import make_grid import repackage repackage...
en
0.748344
# generate # build class grid # add unnormalized mask # save to disk # save the image # generate # save_images # total number of episodes, accounted for batch accumulation # directories for experiments # fixed noise sample # Training Loop # Losses # backprop # Saving # Logging # Calculate Inception SCore # model init #...
1.729222
2
portfolio/urls.py
ramza007/Ramza.io
3
4119
<reponame>ramza007/Ramza.io<gh_stars>1-10 from django.conf.urls import url from django.urls import path, include,re_path from . import views from rest_framework.authtoken.views import obtain_auth_token urlpatterns = [ path('', views.index, name='index'), path('about', views.about, name='about'), path('pr...
from django.conf.urls import url from django.urls import path, include,re_path from . import views from rest_framework.authtoken.views import obtain_auth_token urlpatterns = [ path('', views.index, name='index'), path('about', views.about, name='about'), path('projects', views.projects, name='projects'),...
none
1
1.878728
2
tests/resources/mlflow-test-plugin/mlflow_test_plugin/file_store.py
iPieter/kiwi
0
4120
<reponame>iPieter/kiwi from six.moves import urllib from kiwi.store.tracking.file_store import FileStore class PluginFileStore(FileStore): """FileStore provided through entrypoints system""" def __init__(self, store_uri=None, artifact_uri=None): path = urllib.parse.urlparse(store_uri).path if store_...
from six.moves import urllib from kiwi.store.tracking.file_store import FileStore class PluginFileStore(FileStore): """FileStore provided through entrypoints system""" def __init__(self, store_uri=None, artifact_uri=None): path = urllib.parse.urlparse(store_uri).path if store_uri else None s...
en
0.842814
FileStore provided through entrypoints system
2.029707
2
tests/server/test_flask_api.py
YuhangCh/terracotta
0
4121
<filename>tests/server/test_flask_api.py from io import BytesIO import json import urllib.parse from collections import OrderedDict from PIL import Image import numpy as np import pytest @pytest.fixture(scope='module') def flask_app(): from terracotta.server import create_app return create_app() @pytest.f...
<filename>tests/server/test_flask_api.py from io import BytesIO import json import urllib.parse from collections import OrderedDict from PIL import Image import numpy as np import pytest @pytest.fixture(scope='module') def flask_app(): from terracotta.server import create_app return create_app() @pytest.f...
en
0.354989
# no page (implicit 0) # second page # page out of range # invalid page # invalid limit # default tile size # custom tile size # too few keys # invalid expression # no stretch range # no expression # missing operand # invalid stretch range (syntax) # invalid stretch range (value)
2.142647
2
url.py
matthieucan/shorturl
1
4122
<filename>url.py def base_conv(n, input_base=10, output_base=10): """ Converts a number n from base input_base to base output_base. The following symbols are used to represent numbers: 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ n can be an int if input_base <= 10, and a stri...
<filename>url.py def base_conv(n, input_base=10, output_base=10): """ Converts a number n from base input_base to base output_base. The following symbols are used to represent numbers: 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ n can be an int if input_base <= 10, and a stri...
en
0.621598
Converts a number n from base input_base to base output_base. The following symbols are used to represent numbers: 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ n can be an int if input_base <= 10, and a string otherwise. The result will be a string. ## base 10 conversion ## base o...
4.132441
4
src/qtt/qiskit/passes.py
codecrap/qtt
0
4123
import logging from typing import Dict, List, Optional import numpy as np import qiskit from qiskit.circuit import Barrier, Delay, Reset from qiskit.circuit.library import (CRXGate, CRYGate, CRZGate, CZGate, PhaseGate, RXGate, RYGate, RZGate, U1Gate, ...
import logging from typing import Dict, List, Optional import numpy as np import qiskit from qiskit.circuit import Barrier, Delay, Reset from qiskit.circuit.library import (CRXGate, CRYGate, CRZGate, CZGate, PhaseGate, RXGate, RYGate, RZGate, U1Gate, ...
en
0.810207
Return a circuit with small rotation gates removed. Remove all small rotations from a circuit Args: epsilon: Threshold for rotation angle to be removed modulo2pi: If True, then rotations multiples of 2pi are removed as well Run the pass on `dag`. Args: dag: input dag....
2.239106
2
IAFNNESTA.py
JonathanAlis/IAFNNESTA
3
4124
def help(): return ''' Isotropic-Anisotropic Filtering Norm Nesterov Algorithm Solves the filtering norm minimization + quadratic term problem Nesterov algorithm, with continuation: argmin_x || iaFN(x) ||_1/2 subjected to ||b - Ax||_2^2 < delta If no filter is provided, solves the L1. Continuation is perf...
def help(): return ''' Isotropic-Anisotropic Filtering Norm Nesterov Algorithm Solves the filtering norm minimization + quadratic term problem Nesterov algorithm, with continuation: argmin_x || iaFN(x) ||_1/2 subjected to ||b - Ax||_2^2 < delta If no filter is provided, solves the L1. Continuation is perf...
en
0.701154
Isotropic-Anisotropic Filtering Norm Nesterov Algorithm Solves the filtering norm minimization + quadratic term problem Nesterov algorithm, with continuation: argmin_x || iaFN(x) ||_1/2 subjected to ||b - Ax||_2^2 < delta If no filter is provided, solves the L1. Continuation is performed by sequentially apply...
3.403262
3
hypatia/util/__init__.py
pfw/hypatia
0
4125
<reponame>pfw/hypatia<gh_stars>0 import itertools import BTrees from persistent import Persistent from ZODB.broken import Broken from zope.interface import implementer _marker = object() from .. import exc from ..interfaces import ( IResultSet, STABLE, ) @implementer(IResultSet) class ResultSet(object): ...
import itertools import BTrees from persistent import Persistent from ZODB.broken import Broken from zope.interface import implementer _marker = object() from .. import exc from ..interfaces import ( IResultSet, STABLE, ) @implementer(IResultSet) class ResultSet(object): """Implements :class:`hypatia.i...
en
0.803405
Implements :class:`hypatia.interfaces.IResultSet` # only guaranteed to be iterable, not sliceable # indexes have no obligation to be able to sort generators # return the first object or None # if self.ids is not a list or a tuple, allow this result set # to be iterated after first() is called and allow first() to # be ...
2.216627
2
backend/listings/migrations/0001_initial.py
relaxxpls/Music-Control
0
4126
<filename>backend/listings/migrations/0001_initial.py # Generated by Django 3.2.3 on 2021-05-30 04:28 from django.db import migrations, models import django.db.models.deletion import django.utils.timezone class Migration(migrations.Migration): initial = True dependencies = [ ('realtors', '0001_init...
<filename>backend/listings/migrations/0001_initial.py # Generated by Django 3.2.3 on 2021-05-30 04:28 from django.db import migrations, models import django.db.models.deletion import django.utils.timezone class Migration(migrations.Migration): initial = True dependencies = [ ('realtors', '0001_init...
en
0.890719
# Generated by Django 3.2.3 on 2021-05-30 04:28
1.817492
2
examples/example_without_CommandSet/my_listeners.py
LeConstellationniste/DiscordFramework
1
4127
import asyncio import discord # Just with a function to add to the bot. async def on_message(message): if not message.author.bot: await message.channel.send(f"{message.author.mention} a envoyé un message!") # A Listener already created with the function from discordEasy.objects import Listener async def on_messa...
import asyncio import discord # Just with a function to add to the bot. async def on_message(message): if not message.author.bot: await message.channel.send(f"{message.author.mention} a envoyé un message!") # A Listener already created with the function from discordEasy.objects import Listener async def on_messa...
en
0.849841
# Just with a function to add to the bot. # A Listener already created with the function
2.784222
3
pianonet/serving/app.py
robgon-art/pianonet
14
4128
import os import random from flask import Flask, request, send_from_directory from werkzeug.utils import secure_filename from pianonet.core.pianoroll import Pianoroll from pianonet.model_inspection.performance_from_pianoroll import get_performance_from_pianoroll app = Flask(__name__) base_path = "/app/" # base_pat...
import os import random from flask import Flask, request, send_from_directory from werkzeug.utils import secure_filename from pianonet.core.pianoroll import Pianoroll from pianonet.model_inspection.performance_from_pianoroll import get_performance_from_pianoroll app = Flask(__name__) base_path = "/app/" # base_pat...
en
0.836569
# base_path = "/Users/angsten/PycharmProjects/pianonet" Get a random midi file name that will not ever collide. Returns full path to performaqnce midi file given a file name. Returns the requested performance as midi file. Expected query string is 'midi_file_name', such as 1234.midi Expects post form data as follow...
2.587885
3
app.py
rafalbigaj/epidemic-model-visualization
0
4129
import dash import dash_bootstrap_components as dbc import dash_core_components as dcc import dash_html_components as html import plotly.graph_objects as go from plotly.subplots import make_subplots import logging import json import os import pandas as pd from datetime import datetime from datetime import timedelta fro...
import dash import dash_bootstrap_components as dbc import dash_core_components as dcc import dash_html_components as html import plotly.graph_objects as go from plotly.subplots import make_subplots import logging import json import os import pandas as pd from datetime import datetime from datetime import timedelta fro...
en
0.499769
# predict_range = 14 # sir_result = score(token, 'SIR', datetime(2020, 3, 3), 'Poland', predict_range, 10_000, 20, 10) # logistic_result = score(token, 'LOGISTIC', datetime(2020, 3, 3), 'Poland', predict_range, 10_000, 20, 10) # days = list(sir_result.index) # fig = go.Figure( # data=[ # go.Scatter(x=days, ...
2.102225
2
src/sweetrpg_library_api/application/blueprints/systems/manager.py
paulyhedral/sweetrpg-library-api
0
4130
# -*- coding: utf-8 -*- __author__ = "<NAME> <<EMAIL>>" """ """ from flask_rest_jsonapi import ResourceList, ResourceDetail, ResourceRelationship from sweetrpg_library_objects.api.system.schema import SystemAPISchema from sweetrpg_api_core.data import APIData from sweetrpg_library_objects.model.system import System f...
# -*- coding: utf-8 -*- __author__ = "<NAME> <<EMAIL>>" """ """ from flask_rest_jsonapi import ResourceList, ResourceDetail, ResourceRelationship from sweetrpg_library_objects.api.system.schema import SystemAPISchema from sweetrpg_api_core.data import APIData from sweetrpg_library_objects.model.system import System f...
en
0.500999
# -*- coding: utf-8 -*- # class SystemAuthorRelationship(ResourceRelationship): # schema = SystemAPISchema # data_layer = { # "class": APIData, # "type": "system", # "model": System, # "db": db, # "model_info": model_info # }
2.171646
2
tests/test_ordering.py
deepio-oc/pabot
379
4131
from robot import __version__ as ROBOT_VERSION import sys import tempfile import textwrap import unittest import shutil import subprocess class PabotOrderingGroupTest(unittest.TestCase): def setUp(self): self.tmpdir = tempfile.mkdtemp() def tearDown(self): shutil.rmtree(self.tmpdir) def ...
from robot import __version__ as ROBOT_VERSION import sys import tempfile import textwrap import unittest import shutil import subprocess class PabotOrderingGroupTest(unittest.TestCase): def setUp(self): self.tmpdir = tempfile.mkdtemp() def tearDown(self): shutil.rmtree(self.tmpdir) def ...
en
0.350355
*** Variables *** ${SCALAR} Hello, globe! *** Test Cases *** First Test Set Suite Variable ${SCALAR} Hello, world! Second Test Should Be Equal ${SCALAR} Hello, world! Third Test Should Be Equal ${SCALAR} Hello, globe! { --test Tes...
2.433059
2
setup.py
Commonists/pageview-api
21
4132
<reponame>Commonists/pageview-api<filename>setup.py #!/usr/bin/python # -*- coding: latin-1 -*- """Setup script.""" try: from setuptools import setup except ImportError: from distutils.core import setup try: import pageviewapi version = pageviewapi.__version__ except ImportError: version = 'Undef...
#!/usr/bin/python # -*- coding: latin-1 -*- """Setup script.""" try: from setuptools import setup except ImportError: from distutils.core import setup try: import pageviewapi version = pageviewapi.__version__ except ImportError: version = 'Undefined' classifiers = [ 'Development Status :: 4...
en
0.343251
#!/usr/bin/python # -*- coding: latin-1 -*- Setup script.
1.37089
1
task1b.py
juby-gif/assignment1
0
4133
<reponame>juby-gif/assignment1<gh_stars>0 #a2_t1b.py #This program is to convert Celsius to Kelvin def c_to_k(c): k = c + 273.15 #Formula to convert Celsius to Kelvin return k def f_to_c(f): fa = (f-32) * 5/9 #Formula to convert Fareheit to Celsius return fa c = 25.0 f = 100.0 k = c_to_k(c) fa = f_to_...
#a2_t1b.py #This program is to convert Celsius to Kelvin def c_to_k(c): k = c + 273.15 #Formula to convert Celsius to Kelvin return k def f_to_c(f): fa = (f-32) * 5/9 #Formula to convert Fareheit to Celsius return fa c = 25.0 f = 100.0 k = c_to_k(c) fa = f_to_c(f) print("Celsius of " + str(c) + " is...
en
0.640906
#a2_t1b.py #This program is to convert Celsius to Kelvin #Formula to convert Celsius to Kelvin #Formula to convert Fareheit to Celsius
3.807053
4
TWLight/emails/views.py
jajodiaraghav/TWLight
1
4134
<filename>TWLight/emails/views.py from django.contrib import messages from django.contrib.auth.decorators import login_required from django.core.exceptions import PermissionDenied from django.core.urlresolvers import reverse, reverse_lazy from django.core.mail import BadHeaderError, send_mail from django.http import Ht...
<filename>TWLight/emails/views.py from django.contrib import messages from django.contrib.auth.decorators import login_required from django.core.exceptions import PermissionDenied from django.core.urlresolvers import reverse, reverse_lazy from django.core.mail import BadHeaderError, send_mail from django.http import Ht...
en
0.866397
# @TODO: This sort of gets repeated in ContactUsForm. # We could probably be factored out to a common place for DRYness. # Adding an extra check to ensure the user is a wikipedia editor. # Translators: Shown to users when they successfully submit a new message using the contact us form. # Translators: This message is s...
2.113724
2
frontend/config.py
lcbm/cs-data-ingestion
0
4135
<filename>frontend/config.py """Flask App configuration file.""" import logging import os import dotenv import frontend.constants as constants dotenv.load_dotenv(os.path.join(constants.BASEDIR, "frontend.env")) class Base: """Configuration class used as base for all environments.""" DEBUG = False TE...
<filename>frontend/config.py """Flask App configuration file.""" import logging import os import dotenv import frontend.constants as constants dotenv.load_dotenv(os.path.join(constants.BASEDIR, "frontend.env")) class Base: """Configuration class used as base for all environments.""" DEBUG = False TE...
en
0.612418
Flask App configuration file. Configuration class used as base for all environments. Configuration class for development environment. Parameters ---------- Base: base configuration object. Configuration class for development staging environment. Parameters ---------- Base: base configuration o...
2.936374
3
tests/test_dsl.py
goodreferences/ElasticQuery
0
4136
<filename>tests/test_dsl.py<gh_stars>0 # ElasticQuery # File: tests/test_dsl.py # Desc: tests for ElasticQuery DSL objects (Filter, Query, Aggregate) from os import path from unittest import TestCase from jsontest import JsonTest from elasticquery import Query, Aggregate, Suggester from elasticquery.exceptions impor...
<filename>tests/test_dsl.py<gh_stars>0 # ElasticQuery # File: tests/test_dsl.py # Desc: tests for ElasticQuery DSL objects (Filter, Query, Aggregate) from os import path from unittest import TestCase from jsontest import JsonTest from elasticquery import Query, Aggregate, Suggester from elasticquery.exceptions impor...
en
0.553623
# ElasticQuery # File: tests/test_dsl.py # Desc: tests for ElasticQuery DSL objects (Filter, Query, Aggregate) # Test passing not a list # And now an invalid list # And now an invalid list # And now an invalid list # Empty list should be OK/ignored
2.491397
2
models/SelectionGAN/person_transfer/tool/rm_insnorm_running_vars.py
xianjian-xie/pose-generation
445
4137
import torch ckp_path = './checkpoints/fashion_PATN/latest_net_netG.pth' save_path = './checkpoints/fashion_PATN_v1.0/latest_net_netG.pth' states_dict = torch.load(ckp_path) states_dict_new = states_dict.copy() for key in states_dict.keys(): if "running_var" in key or "running_mean" in key: del states_dict_new[key]...
import torch ckp_path = './checkpoints/fashion_PATN/latest_net_netG.pth' save_path = './checkpoints/fashion_PATN_v1.0/latest_net_netG.pth' states_dict = torch.load(ckp_path) states_dict_new = states_dict.copy() for key in states_dict.keys(): if "running_var" in key or "running_mean" in key: del states_dict_new[key]...
none
1
2.017745
2
script/dummy/arm_control.py
amazon-picking-challenge/team_pfn
7
4138
<filename>script/dummy/arm_control.py #!/usr/bin/python # Copyright 2016 Preferred Networks, 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/LICEN...
<filename>script/dummy/arm_control.py #!/usr/bin/python # Copyright 2016 Preferred Networks, 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/LICEN...
en
0.839168
#!/usr/bin/python # Copyright 2016 Preferred Networks, 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 required by applicabl...
2.256904
2
cogs/events.py
rompdodger/RompDodger
0
4139
<gh_stars>0 import json import discord from utils.time import format_time from utils import utilities from discord.ext import commands from discord import Embed class Events(commands.Cog): """Event Handler for RompDodger""" def __init__(self, bot): self.bot = bot @commands.Cog.listener() async def on_command...
import json import discord from utils.time import format_time from utils import utilities from discord.ext import commands from discord import Embed class Events(commands.Cog): """Event Handler for RompDodger""" def __init__(self, bot): self.bot = bot @commands.Cog.listener() async def on_command_error(self,...
en
0.242782
Event Handler for RompDodger #TODO: implement blacklist sytem
2.608449
3
Task/Parallel-calculations/Python/parallel-calculations-2.py
LaudateCorpus1/RosettaCodeData
1
4140
import multiprocessing # ========== #Python3 - concurrent from math import floor, sqrt numbers = [ 112272537195293, 112582718962171, 112272537095293, 115280098190773, 115797840077099, 1099726829285419] # numbers = [33, 44, 55, 275] def lowest_factor(n, _start=3): if n % 2 == 0: re...
import multiprocessing # ========== #Python3 - concurrent from math import floor, sqrt numbers = [ 112272537195293, 112582718962171, 112272537095293, 115280098190773, 115797840077099, 1099726829285419] # numbers = [33, 44, 55, 275] def lowest_factor(n, _start=3): if n % 2 == 0: re...
en
0.631934
# ========== #Python3 - concurrent # numbers = [33, 44, 55, 275] # ========== #Python3 - concurrent
3.43111
3
setup.py
clin366/airpollutionnowcast
0
4141
from setuptools import find_packages, setup setup( name='src', packages=find_packages(), version='0.1.0', description='Project: Nowcasting the air pollution using online search log', author='<NAME>(IR Lab)', license='MIT', )
from setuptools import find_packages, setup setup( name='src', packages=find_packages(), version='0.1.0', description='Project: Nowcasting the air pollution using online search log', author='<NAME>(IR Lab)', license='MIT', )
none
1
1.072381
1
problems/p0048/s48.py
ahrarmonsur/euler
1
4142
""" Project Euler Problem 48 Self powers Solved by <NAME> The series, 1^1 + 2^2 + 3^3 + ... + 10^10 = 10405071317. Find the last ten digits of the series, 1^1 + 2^2 + 3^3 + ... + 1000^1000. """ def main(): max_digits = 1000 sum = 0 for i in range(1, max_digits+1): sum += i**i print str(sum)[-...
""" Project Euler Problem 48 Self powers Solved by <NAME> The series, 1^1 + 2^2 + 3^3 + ... + 10^10 = 10405071317. Find the last ten digits of the series, 1^1 + 2^2 + 3^3 + ... + 1000^1000. """ def main(): max_digits = 1000 sum = 0 for i in range(1, max_digits+1): sum += i**i print str(sum)[-...
en
0.624417
Project Euler Problem 48 Self powers Solved by <NAME> The series, 1^1 + 2^2 + 3^3 + ... + 10^10 = 10405071317. Find the last ten digits of the series, 1^1 + 2^2 + 3^3 + ... + 1000^1000.
3.560129
4
BigData/sparkTask/test.py
Rainstyd/rainsty
1
4143
<filename>BigData/sparkTask/test.py #!/usr/bin/python # -*- coding: utf-8 -*- """ @author: rainsty @file: test.py @time: 2020-01-04 18:36:57 @description: """ import os from pyspark.sql import SparkSession os.environ['JAVA_HOME'] = '/root/jdk' os.environ['SPARK_HOME'] = '/root/spark' os.environ['PYTHON_HOME'] = ...
<filename>BigData/sparkTask/test.py #!/usr/bin/python # -*- coding: utf-8 -*- """ @author: rainsty @file: test.py @time: 2020-01-04 18:36:57 @description: """ import os from pyspark.sql import SparkSession os.environ['JAVA_HOME'] = '/root/jdk' os.environ['SPARK_HOME'] = '/root/spark' os.environ['PYTHON_HOME'] = ...
en
0.494054
#!/usr/bin/python # -*- coding: utf-8 -*- @author: rainsty @file: test.py @time: 2020-01-04 18:36:57 @description:
2.535727
3
esercizi/areaSottesaCompareNumPy.py
gdv/python-alfabetizzazione
0
4144
<reponame>gdv/python-alfabetizzazione<filename>esercizi/areaSottesaCompareNumPy.py import numpy as np import timeit def effe(x): y = -x * (x - 1.0) return y numIntervalli = input('inserire il numero di intervalli in [0.0, 1.0] ') deltaIntervallo = 1.0 / float(numIntervalli) print "larghezza intervallo", de...
import numpy as np import timeit def effe(x): y = -x * (x - 1.0) return y numIntervalli = input('inserire il numero di intervalli in [0.0, 1.0] ') deltaIntervallo = 1.0 / float(numIntervalli) print "larghezza intervallo", deltaIntervallo start = timeit.default_timer() xIntervalli = [] yIntervalli = [] i =...
en
0.201703
# print xNPIntervalli # print xIntervalli # print yNPIntervalli # print yIntervalli
3.005918
3
json_codegen/generators/python3_marshmallow/object_generator.py
expobrain/json-schema-codegen
21
4145
import ast from json_codegen.generators.python3_marshmallow.utils import Annotations, class_name class ObjectGenerator(object): @staticmethod def _get_property_name(node_assign): name = node_assign.targets[0] return name.id @staticmethod def _nesting_class(node_assign): for n...
import ast from json_codegen.generators.python3_marshmallow.utils import Annotations, class_name class ObjectGenerator(object): @staticmethod def _get_property_name(node_assign): name = node_assign.targets[0] return name.id @staticmethod def _nesting_class(node_assign): for n...
en
0.534558
If the nested list is non-primitive, initialise sub-classes in a list comp If the nest is primitive, we can simply get it Marshmallow will do the type marshalling Required property -> self.prop = parent_dict["prop"] Optional property -> self.prop = parent_dict.get("prop") ...
2.620723
3
testing/regrid/testEsmfGridToMeshRegridCsrv.py
xylar/cdat
62
4146
<filename>testing/regrid/testEsmfGridToMeshRegridCsrv.py #!/usr/bin/env python # # $Id: ESMP_GridToMeshRegridCsrv.py,v 1.5 2012/04/23 23:00:14 rokuingh Exp $ #=============================================================================== # ESMP/examples/ESMP_GridToMeshRegrid.py #===========================...
<filename>testing/regrid/testEsmfGridToMeshRegridCsrv.py #!/usr/bin/env python # # $Id: ESMP_GridToMeshRegridCsrv.py,v 1.5 2012/04/23 23:00:14 rokuingh Exp $ #=============================================================================== # ESMP/examples/ESMP_GridToMeshRegrid.py #===========================...
en
0.715889
#!/usr/bin/env python # # $Id: ESMP_GridToMeshRegridCsrv.py,v 1.5 2012/04/23 23:00:14 rokuingh Exp $ #=============================================================================== # ESMP/examples/ESMP_GridToMeshRegrid.py #=============================================================================== ESMP...
2.329499
2
test/mock_module.py
ariffyasri/lale
1
4147
# Copyright 2019 IBM Corporation # # 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 writing, ...
# Copyright 2019 IBM Corporation # # 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 writing, ...
en
0.845772
# Copyright 2019 IBM Corporation # # 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 writing, ...
2.1516
2
scripts/beautify.py
lukaschoebel/POTUSgen
0
4148
<gh_stars>0 import json import re import sys def beautify(name): ''' Loading, filtering and saving the JSON tweet file to a newly generated .txt file :type: name: String :rtype: output: .txt ''' filename = name + '.json' output_name = name + "_filtered.txt" with open(filename, "r", encod...
import json import re import sys def beautify(name): ''' Loading, filtering and saving the JSON tweet file to a newly generated .txt file :type: name: String :rtype: output: .txt ''' filename = name + '.json' output_name = name + "_filtered.txt" with open(filename, "r", encoding="utf-8")...
en
0.717788
Loading, filtering and saving the JSON tweet file to a newly generated .txt file :type: name: String :rtype: output: .txt # Filter only the messages that are not retweeted # >> Version i): for tweets from archive "master_XXXX.json" # document = [x['full_text'] for x in document if x['user']['screen_name'] == 'r...
3.449466
3
result2gaofentype/pkl2txt_ggm.py
G-Naughty/Fine-grained-OBB-Detection
2
4149
import BboxToolkit as bt import pickle import copy import numpy as np path1="/home/hnu1/GGM/OBBDetection/work_dir/oriented_obb_contrast_catbalance/dets.pkl" path2="/home/hnu1/GGM/OBBDetection/data/FaIR1M/test/annfiles/ori_annfile.pkl"# with open(path2,'rb') as f: #/home/disk/FAIR1M_1000_split/val/annfiles/ori_...
import BboxToolkit as bt import pickle import copy import numpy as np path1="/home/hnu1/GGM/OBBDetection/work_dir/oriented_obb_contrast_catbalance/dets.pkl" path2="/home/hnu1/GGM/OBBDetection/data/FaIR1M/test/annfiles/ori_annfile.pkl"# with open(path2,'rb') as f: #/home/disk/FAIR1M_1000_split/val/annfiles/ori_...
en
0.572258
#/home/disk/FAIR1M_1000_split/val/annfiles/ori_annfile.pkl
2.072259
2
initializer_3d.py
HarperCallahan/taichi_ferrofluid
0
4150
import taichi as ti import utils from apic_extension import * @ti.data_oriented class Initializer3D: # tmp initializer def __init__(self, res, x0, y0, z0, x1, y1, z1): self.res = res self.x0 = int(res * x0) self.y0 = int(res * y0) self.z0 = int(res * z0) self.x1 = int(res * ...
import taichi as ti import utils from apic_extension import * @ti.data_oriented class Initializer3D: # tmp initializer def __init__(self, res, x0, y0, z0, x1, y1, z1): self.res = res self.x0 = int(res * x0) self.y0 = int(res * y0) self.z0 = int(res * z0) self.x1 = int(res * ...
en
0.315894
# tmp initializer
2.357085
2
copy_block_example.py
MilesCranmer/bifrost_paper
0
4151
<gh_stars>0 from copy import deepcopy import bifrost as bf from bifrost.pipeline import TransformBlock from bifrost.ndarray import copy_array class CopyBlock(TransformBlock):# $\tikzmark{block-start}$ """Copy the input ring to output ring""" def __init__(self, iring...
from copy import deepcopy import bifrost as bf from bifrost.pipeline import TransformBlock from bifrost.ndarray import copy_array class CopyBlock(TransformBlock):# $\tikzmark{block-start}$ """Copy the input ring to output ring""" def __init__(self, iring, space): ...
en
0.383421
# $\tikzmark{block-start}$ Copy the input ring to output ring #$\tikzmark{block-end}$ # $\tikzmark{gpu-start}$ #$\tikzmark{gpu-end}$ # $\tikzmark{pipeline-start}$ #$\tikzmark{pipeline-end}$
2.157145
2
monasca_persister/conf/influxdb.py
zhangjianweibj/monasca-persister
0
4152
# (C) Copyright 2016-2017 Hewlett Packard Enterprise Development LP # Copyright 2017 FUJITSU LIMITED # # 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...
# (C) Copyright 2016-2017 Hewlett Packard Enterprise Development LP # Copyright 2017 FUJITSU LIMITED # # 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...
en
0.820811
# (C) Copyright 2016-2017 Hewlett Packard Enterprise Development LP # Copyright 2017 FUJITSU LIMITED # # 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...
1.944399
2
test_print_json.py
huangsen365/boto3-docker
0
4153
import json your_json = '["foo", {"bar":["baz", null, 1.0, 2]}]' parsed = json.loads(your_json) print(type(your_json)) print(type(parsed)) #print(json.dumps(parsed, indent=4, sort_keys=True))
import json your_json = '["foo", {"bar":["baz", null, 1.0, 2]}]' parsed = json.loads(your_json) print(type(your_json)) print(type(parsed)) #print(json.dumps(parsed, indent=4, sort_keys=True))
et
0.119168
#print(json.dumps(parsed, indent=4, sort_keys=True))
3.143265
3
src/solutions/common/integrations/cirklo/api.py
goubertbrent/oca-backend
0
4154
<filename>src/solutions/common/integrations/cirklo/api.py # -*- coding: utf-8 -*- # Copyright 2020 Green Valley Belgium NV # # 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.a...
<filename>src/solutions/common/integrations/cirklo/api.py # -*- coding: utf-8 -*- # Copyright 2020 Green Valley Belgium NV # # 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.a...
en
0.774673
# -*- coding: utf-8 -*- # Copyright 2020 Green Valley Belgium NV # # 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...
1.377319
1
aplpy/tests/test_grid.py
nbrunett/aplpy
0
4155
import matplotlib matplotlib.use('Agg') import numpy as np from astropy.tests.helper import pytest from .. import FITSFigure def test_grid_addremove(): data = np.zeros((16, 16)) f = FITSFigure(data) f.add_grid() f.remove_grid() f.add_grid() f.close() def test_grid_showhide(): data = np...
import matplotlib matplotlib.use('Agg') import numpy as np from astropy.tests.helper import pytest from .. import FITSFigure def test_grid_addremove(): data = np.zeros((16, 16)) f = FITSFigure(data) f.add_grid() f.remove_grid() f.add_grid() f.close() def test_grid_showhide(): data = np...
none
1
1.996184
2
vz.py
ponyatov/vz
0
4156
import os, sys class Object: ## @name constructor def __init__(self, V): self.value = V self.nest = [] def box(self, that): if isinstance(that, Object): return that if isinstance(that, str): return S(that) raise TypeError(['box', type(that), that]) ## @name d...
import os, sys class Object: ## @name constructor def __init__(self, V): self.value = V self.nest = [] def box(self, that): if isinstance(that, Object): return that if isinstance(that, str): return S(that) raise TypeError(['box', type(that), that]) ## @name d...
en
0.337317
## @name constructor ## @name dump / string # head # subtree ## @name operator # # # # # # # # # # # # # # # # # # # {self.TITLE}' * object (hyper)graph interpreter
3.25124
3
src/server.py
FlakM/fastai_text_serving
0
4157
import asyncio import logging import aiohttp import uvicorn from fastai.vision import * from starlette.applications import Starlette from starlette.middleware.cors import CORSMiddleware from starlette.responses import JSONResponse # put your url here here model_file_url = 'https://www.dropbox.com/s/...?raw=1' model_f...
import asyncio import logging import aiohttp import uvicorn from fastai.vision import * from starlette.applications import Starlette from starlette.middleware.cors import CORSMiddleware from starlette.responses import JSONResponse # put your url here here model_file_url = 'https://www.dropbox.com/s/...?raw=1' model_f...
en
0.865381
# put your url here here # Loading the saved model using fastai's load_learner method
2.215077
2
tcpserver.py
justforbalance/CSnet
0
4158
from socket import * serverPort = 12001 serverSocket = socket(AF_INET, SOCK_STREAM) serverSocket.bind(('', serverPort)) serverSocket.listen(1) print("the server is ready to receive") while True: connectionSocket,addr = serverSocket.accept() sentence = connectionSocket.recv(1024).decode() sentence = sentence...
from socket import * serverPort = 12001 serverSocket = socket(AF_INET, SOCK_STREAM) serverSocket.bind(('', serverPort)) serverSocket.listen(1) print("the server is ready to receive") while True: connectionSocket,addr = serverSocket.accept() sentence = connectionSocket.recv(1024).decode() sentence = sentence...
none
1
3.040711
3
src/geneflow/extend/local_workflow.py
jhphan/geneflow2
7
4159
"""This module contains the GeneFlow LocalWorkflow class.""" class LocalWorkflow: """ A class that represents the Local Workflow objects. """ def __init__( self, job, config, parsed_job_work_uri ): """ Instantiate LocalWorkflow class....
"""This module contains the GeneFlow LocalWorkflow class.""" class LocalWorkflow: """ A class that represents the Local Workflow objects. """ def __init__( self, job, config, parsed_job_work_uri ): """ Instantiate LocalWorkflow class....
en
0.759082
This module contains the GeneFlow LocalWorkflow class. A class that represents the Local Workflow objects. Instantiate LocalWorkflow class. Initialize the LocalWorkflow class. This workflow class has no additional functionality. Args: None. Returns: True. Initialize an...
2.68683
3
S12/tensornet/engine/ops/lr_scheduler.py
abishek-raju/EVA4B2
4
4160
from torch.optim.lr_scheduler import StepLR, ReduceLROnPlateau, OneCycleLR def step_lr(optimizer, step_size, gamma=0.1, last_epoch=-1): """Create LR step scheduler. Args: optimizer (torch.optim): Model optimizer. step_size (int): Frequency for changing learning rate. gamma (float): Fa...
from torch.optim.lr_scheduler import StepLR, ReduceLROnPlateau, OneCycleLR def step_lr(optimizer, step_size, gamma=0.1, last_epoch=-1): """Create LR step scheduler. Args: optimizer (torch.optim): Model optimizer. step_size (int): Frequency for changing learning rate. gamma (float): Fa...
en
0.705105
Create LR step scheduler. Args: optimizer (torch.optim): Model optimizer. step_size (int): Frequency for changing learning rate. gamma (float): Factor for changing learning rate. (default: 0.1) last_epoch (int): The index of last epoch. (default: -1) Returns: StepLR...
2.626564
3
armi/reactor/tests/test_zones.py
youngmit/armi
0
4161
# Copyright 2019 TerraPower, 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 agreed to in writi...
# Copyright 2019 TerraPower, 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 agreed to in writi...
en
0.898717
# Copyright 2019 TerraPower, 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 agreed to in writi...
1.828434
2
islam_fitz/survey/migrations/0005_auto_20210712_2132.py
OmarEhab177/Islam_fitz
0
4162
<filename>islam_fitz/survey/migrations/0005_auto_20210712_2132.py<gh_stars>0 # Generated by Django 3.1.12 on 2021-07-12 19:32 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('survey', '0004_lastpage_whatsapp_button'), ] operations = [ mi...
<filename>islam_fitz/survey/migrations/0005_auto_20210712_2132.py<gh_stars>0 # Generated by Django 3.1.12 on 2021-07-12 19:32 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('survey', '0004_lastpage_whatsapp_button'), ] operations = [ mi...
en
0.811467
# Generated by Django 3.1.12 on 2021-07-12 19:32
1.484305
1
Examples/WorkingWithOutlookMSGs/CreateAndSaveOutlookNote.py
Muzammil-khan/Aspose.Email-Python-Dotnet
5
4163
<filename>Examples/WorkingWithOutlookMSGs/CreateAndSaveOutlookNote.py<gh_stars>1-10 import aspose.email.mapi.msg as msg from aspose.email.mapi import MapiNote, NoteSaveFormat, NoteColor def run(): dataDir = "Data/" #ExStart: CreateAndSaveOutlookNote note3 = MapiNote() note3.subject = "Blue color note" note3.body...
<filename>Examples/WorkingWithOutlookMSGs/CreateAndSaveOutlookNote.py<gh_stars>1-10 import aspose.email.mapi.msg as msg from aspose.email.mapi import MapiNote, NoteSaveFormat, NoteColor def run(): dataDir = "Data/" #ExStart: CreateAndSaveOutlookNote note3 = MapiNote() note3.subject = "Blue color note" note3.body...
en
0.413777
#ExStart: CreateAndSaveOutlookNote #ExEnd: CreateAndSaveOutlookNote
2.670219
3
nonebot/internal/adapter/template.py
mobyw/nonebot2
0
4164
<gh_stars>0 import functools from string import Formatter from typing import ( TYPE_CHECKING, Any, Set, Dict, List, Type, Tuple, Union, Generic, Mapping, TypeVar, Callable, Optional, Sequence, cast, overload, ) if TYPE_CHECKING: from .message import M...
import functools from string import Formatter from typing import ( TYPE_CHECKING, Any, Set, Dict, List, Type, Tuple, Union, Generic, Mapping, TypeVar, Callable, Optional, Sequence, cast, overload, ) if TYPE_CHECKING: from .message import Message, Mess...
en
0.424397
消息模板格式化实现类。 参数: template: 模板 factory: 消息类型工厂,默认为 `str` 根据传入参数和模板生成消息对象 根据传入字典和模板生成消息对象, 在传入字段名不是有效标识符时有用 # type:ignore # output the literal text # if there's a field, output it # this is some markup, find the object and do # the formatting # handle arg indexing when empty field_names are given. # ...
2.667444
3
Others/code_festival/code-festival-2015-final-open/a.py
KATO-Hiro/AtCoder
2
4165
<gh_stars>1-10 # -*- coding: utf-8 -*- def main(): s, t, u = map(str, input().split()) if len(s) == 5 and len(t) == 7 and len(u) == 5: print('valid') else: print('invalid') if __name__ == '__main__': main()
# -*- coding: utf-8 -*- def main(): s, t, u = map(str, input().split()) if len(s) == 5 and len(t) == 7 and len(u) == 5: print('valid') else: print('invalid') if __name__ == '__main__': main()
en
0.769321
# -*- coding: utf-8 -*-
3.469586
3
python_Project/Day_16-20/test_2.py
Zzz-ww/Python-prac
0
4166
<filename>python_Project/Day_16-20/test_2.py """ 嵌套的列表的坑 """ names = ['关羽', '张飞', '赵云', '马超', '黄忠'] courses = ['语文', '数学', '英语'] # 录入五个学生三门课程的成绩 scores = [[None] * len(courses) for _ in range(len(names))] for row, name in enumerate(names): for col, course in enumerate(courses): scores[row][col] = float(in...
<filename>python_Project/Day_16-20/test_2.py """ 嵌套的列表的坑 """ names = ['关羽', '张飞', '赵云', '马超', '黄忠'] courses = ['语文', '数学', '英语'] # 录入五个学生三门课程的成绩 scores = [[None] * len(courses) for _ in range(len(names))] for row, name in enumerate(names): for col, course in enumerate(courses): scores[row][col] = float(in...
zh
0.950431
嵌套的列表的坑 # 录入五个学生三门课程的成绩
3.663794
4
asr/dataloaders/am_dataloader.py
Z-yq/audioSamples.github.io
1
4167
<gh_stars>1-10 import logging import random import numpy as np import pypinyin import tensorflow as tf from augmentations.augments import Augmentation from utils.speech_featurizers import SpeechFeaturizer from utils.text_featurizers import TextFeaturizer logging.basicConfig(level=logging.INFO, format='%(asctime)s - ...
import logging import random import numpy as np import pypinyin import tensorflow as tf from augmentations.augments import Augmentation from utils.speech_featurizers import SpeechFeaturizer from utils.text_featurizers import TextFeaturizer logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(name)s - %(le...
es
0.260375
# print(phones)
2.240523
2
migrations/versions/2018_04_20_data_src_refactor.py
AlexKouzy/ethnicity-facts-and-figures-publisher
0
4168
"""empty message Revision ID: 2018_04_20_data_src_refactor Revises: 2018_04_11_add_sandbox_topic Create Date: 2018-04-20 13:03:32.478880 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. from sqlalchemy.dialects.postgresql import ARRAY revision = '2018_04_20_data_src_refac...
"""empty message Revision ID: 2018_04_20_data_src_refactor Revises: 2018_04_11_add_sandbox_topic Create Date: 2018-04-20 13:03:32.478880 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. from sqlalchemy.dialects.postgresql import ARRAY revision = '2018_04_20_data_src_refac...
en
0.574057
empty message Revision ID: 2018_04_20_data_src_refactor Revises: 2018_04_11_add_sandbox_topic Create Date: 2018-04-20 13:03:32.478880 # revision identifiers, used by Alembic. # ### commands auto generated by Alembic - please adjust! ### UPDATE page SET suppression_and_disclosure = suppression_rules WHERE disc...
1.593389
2
lib/core/parse/cmdline.py
vikas-kundu/phonedict
0
4169
<reponame>vikas-kundu/phonedict<filename>lib/core/parse/cmdline.py<gh_stars>0 #!/usr/bin/env python3 # -*- coding:utf-8 -*- # coded by <NAME> https://github.com/vikas-kundu # ------------------------------------------- import sys import getopt import time import config from lib.core.parse import banner from ...
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # coded by <NAME> https://github.com/vikas-kundu # ------------------------------------------- import sys import getopt import time import config from lib.core.parse import banner from lib.core import util from lib.core import installer def options(): ...
en
0.469939
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # coded by <NAME> https://github.com/vikas-kundu # -------------------------------------------
2.378324
2
mistral/tests/unit/utils/test_utils.py
shubhamdang/mistral
205
4170
# Copyright 2013 - Mirantis, Inc. # Copyright 2015 - StackStorm, Inc. # Copyright 2015 - Huawei Technologies Co. Ltd # # 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:/...
# Copyright 2013 - Mirantis, Inc. # Copyright 2015 - StackStorm, Inc. # Copyright 2015 - Huawei Technologies Co. Ltd # # 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:/...
en
0.830072
# Copyright 2013 - Mirantis, Inc. # Copyright 2015 - StackStorm, Inc. # Copyright 2015 - Huawei Technologies Co. Ltd # # 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:/...
1.935239
2
shoutcast_api/shoutcast_request.py
scls19fr/shoutcast_api
6
4171
import xmltodict import json from .models import Tunein from .utils import _init_session from .Exceptions import APIException base_url = 'http://api.shoutcast.com' tunein_url = 'http://yp.shoutcast.com/{base}?id={id}' tuneins = [Tunein('/sbin/tunein-station.pls'), Tunein('/sbin/tunein-station.m3u'), Tunein('/sbin/tun...
import xmltodict import json from .models import Tunein from .utils import _init_session from .Exceptions import APIException base_url = 'http://api.shoutcast.com' tunein_url = 'http://yp.shoutcast.com/{base}?id={id}' tuneins = [Tunein('/sbin/tunein-station.pls'), Tunein('/sbin/tunein-station.m3u'), Tunein('/sbin/tun...
none
1
2.214867
2
django_app_permissions/management/commands/resolve_app_groups.py
amp89/django-app-permissions
2
4172
from django.core.management.base import BaseCommand, no_translations from django.contrib.auth.models import Group from django.conf import settings import sys class Command(BaseCommand): def handle(self, *args, **options): sys.stdout.write("\nResolving app groups") app_list = [app_name.lower...
from django.core.management.base import BaseCommand, no_translations from django.contrib.auth.models import Group from django.conf import settings import sys class Command(BaseCommand): def handle(self, *args, **options): sys.stdout.write("\nResolving app groups") app_list = [app_name.lower...
none
1
1.993688
2
swift/common/db.py
sunzz679/swift-2.4.0--source-read
0
4173
# Copyright (c) 2010-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 agree...
# Copyright (c) 2010-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 agree...
en
0.764547
# Copyright (c) 2010-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 agree...
1.643178
2
xdl/utils/prop_limits.py
mcrav/xdl
0
4174
<reponame>mcrav/xdl<filename>xdl/utils/prop_limits.py """Prop limits are used to validate the input given to xdl elements. For example, a volume property should be a positive number, optionally followed by volume units. The prop limit is used to check that input supplied is valid for that property. """ import re from ...
"""Prop limits are used to validate the input given to xdl elements. For example, a volume property should be a positive number, optionally followed by volume units. The prop limit is used to check that input supplied is valid for that property. """ import re from typing import List, Optional class PropLimit(object):...
en
0.679187
Prop limits are used to validate the input given to xdl elements. For example, a volume property should be a positive number, optionally followed by volume units. The prop limit is used to check that input supplied is valid for that property. Convenience class for storing prop limit. A prop limit is essentially a r...
3.862722
4
dit/utils/bindargs.py
leoalfonso/dit
1
4175
""" Provides usable args and kwargs from inspect.getcallargs. For Python 3.3 and above, this module is unnecessary and can be achieved using features from PEP 362: http://www.python.org/dev/peps/pep-0362/ For example, to override a parameter of some function: >>> import inspect >>> def func(a, b=1, c=2,...
""" Provides usable args and kwargs from inspect.getcallargs. For Python 3.3 and above, this module is unnecessary and can be achieved using features from PEP 362: http://www.python.org/dev/peps/pep-0362/ For example, to override a parameter of some function: >>> import inspect >>> def func(a, b=1, c=2,...
en
0.571242
Provides usable args and kwargs from inspect.getcallargs. For Python 3.3 and above, this module is unnecessary and can be achieved using features from PEP 362: http://www.python.org/dev/peps/pep-0362/ For example, to override a parameter of some function: >>> import inspect >>> def func(a, b=1, c=2, d=3...
3.391865
3
tests/python/gaia-ui-tests/gaiatest/gaia_test.py
AmyYLee/gaia
1
4176
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import json import os import sys import time from marionette import MarionetteTestCase from marionette.by import By fro...
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import json import os import sys import time from marionette import MarionetteTestCase from marionette.by import By fro...
en
0.769896
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. Returns the value of a Gecko boolean pref, which is different from a Gaia setting. Sets the value of a Gecko boolean pref...
1.994589
2
library/__mozilla__/pyjamas/DOM.py
certik/pyjamas
0
4177
<gh_stars>0 def buttonClick(button): JS(""" var doc = button.ownerDocument; if (doc != null) { var evt = doc.createEvent('MouseEvents'); evt.initMouseEvent('click', true, true, null, 0, 0, 0, 0, 0, false, false, false, false, 0, null); ...
def buttonClick(button): JS(""" var doc = button.ownerDocument; if (doc != null) { var evt = doc.createEvent('MouseEvents'); evt.initMouseEvent('click', true, true, null, 0, 0, 0, 0, 0, false, false, false, false, 0, null); button.d...
en
0.239712
var doc = button.ownerDocument; if (doc != null) { var evt = doc.createEvent('MouseEvents'); evt.initMouseEvent('click', true, true, null, 0, 0, 0, 0, 0, false, false, false, false, 0, null); button.dispatchEvent(evt); } if (!elem1 && !...
1.868872
2
apps/vendors/migrations/0090_auto_20160610_2125.py
ExpoAshique/ProveBanking__s
0
4178
# -*- coding: utf-8 -*- # Generated by Django 1.9.6 on 2016-06-10 21:25 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('vendors', '0089_auto_20160602_2123'), ] operations = [ migrations.AlterField...
# -*- coding: utf-8 -*- # Generated by Django 1.9.6 on 2016-06-10 21:25 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('vendors', '0089_auto_20160602_2123'), ] operations = [ migrations.AlterField...
en
0.810742
# -*- coding: utf-8 -*- # Generated by Django 1.9.6 on 2016-06-10 21:25
1.358124
1
graph/articulation_points.py
fujihiraryo/library
0
4179
<gh_stars>0 from depth_first_search import DFS def articulation_points(graph): n = len(graph) dfs = DFS(graph) order = [None] * n for i, x in enumerate(dfs.preorder): order[x] = i lower = order[:] for x in dfs.preorder[::-1]: for y in graph[x]: if y == dfs.parent[x]...
from depth_first_search import DFS def articulation_points(graph): n = len(graph) dfs = DFS(graph) order = [None] * n for i, x in enumerate(dfs.preorder): order[x] = i lower = order[:] for x in dfs.preorder[::-1]: for y in graph[x]: if y == dfs.parent[x]: ...
none
1
3.166915
3
database.py
AndreAngelucci/popcorn_time_bot
0
4180
import pymongo from conf import Configuracoes class Mongo_Database: """ Singleton com a conexao com o MongoDB """ _instancia = None def __new__(cls, *args, **kwargs): if not(cls._instancia): cls._instancia = super(Mongo_Database, cls).__new__(cls, *args, **kwargs) return cls._in...
import pymongo from conf import Configuracoes class Mongo_Database: """ Singleton com a conexao com o MongoDB """ _instancia = None def __new__(cls, *args, **kwargs): if not(cls._instancia): cls._instancia = super(Mongo_Database, cls).__new__(cls, *args, **kwargs) return cls._in...
pt
0.468679
Singleton com a conexao com o MongoDB #pega a string de conexao no arquivo de configuracao #verifica se o filme ja existe #se nao existir, grava e adiciona a lista de novos filmes #grava o retorno dos tweets
2.867312
3
sensor_core/sleep.py
JorisHerbots/niip_iot_zombie_apocalypse
0
4181
<gh_stars>0 import machine import pycom import utime from exceptions import Exceptions class Sleep: @property def wakeReason(self): return machine.wake_reason()[0] @property def wakePins(self): return machine.wake_reason()[1] @property def powerOnWake(self): ...
import machine import pycom import utime from exceptions import Exceptions class Sleep: @property def wakeReason(self): return machine.wake_reason()[0] @property def wakePins(self): return machine.wake_reason()[1] @property def powerOnWake(self): return...
en
0.605468
# P2, P3, P4, P6, P8 to P10 and P13 to P23 # 1 week
2.43233
2
pytorch_gleam/search/rerank_format.py
Supermaxman/pytorch-gleam
0
4182
<reponame>Supermaxman/pytorch-gleam<gh_stars>0 import torch import argparse from collections import defaultdict import os import json def load_predictions(input_path): pred_list = [] for file_name in os.listdir(input_path): if file_name.endswith('.pt'): preds = torch.load(os.path.join(input_path, file_name)) ...
import torch import argparse from collections import defaultdict import os import json def load_predictions(input_path): pred_list = [] for file_name in os.listdir(input_path): if file_name.endswith('.pt'): preds = torch.load(os.path.join(input_path, file_name)) pred_list.extend(preds) question_scores = d...
en
0.663174
# score = prediction['pos_score']
2.482775
2
des036.py
LeonardoPereirajr/Curso_em_video_Python
0
4183
casa = int(input('Qual o valor da casa? ')) sal = int(input('Qual seu salario? ')) prazo = int(input('Quantos meses deseja pagar ? ')) parcela = casa/prazo margem = sal* (30/100) if parcela > margem: print('Este negocio não foi aprovado, aumente o prazo .') else: print("Negocio aprovado pois a parcela é...
casa = int(input('Qual o valor da casa? ')) sal = int(input('Qual seu salario? ')) prazo = int(input('Quantos meses deseja pagar ? ')) parcela = casa/prazo margem = sal* (30/100) if parcela > margem: print('Este negocio não foi aprovado, aumente o prazo .') else: print("Negocio aprovado pois a parcela é...
none
1
3.849036
4
HackBitApp/migrations/0003_roadmap.py
SukhadaM/HackBit-Interview-Preparation-Portal
0
4184
# Generated by Django 3.1.7 on 2021-03-27 18:22 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('HackBitApp', '0002_company_photo'), ] operations = [ migrations.CreateModel( name='Roadmap', fields=[ ...
# Generated by Django 3.1.7 on 2021-03-27 18:22 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('HackBitApp', '0002_company_photo'), ] operations = [ migrations.CreateModel( name='Roadmap', fields=[ ...
en
0.808959
# Generated by Django 3.1.7 on 2021-03-27 18:22
1.729421
2
Other_Python/Kernel_Methods/matrix_operations.py
Romit-Maulik/Tutorials-Demos-Practice
0
4185
<reponame>Romit-Maulik/Tutorials-Demos-Practice<filename>Other_Python/Kernel_Methods/matrix_operations.py # -*- coding: utf-8 -*- """ Created on Wed Jul 22 14:36:48 2020 @author: matth """ import autograd.numpy as np #%% Kernel operations # Returns the norm of the pairwise difference def norm_matrix(matrix_1, matrix...
# -*- coding: utf-8 -*- """ Created on Wed Jul 22 14:36:48 2020 @author: matth """ import autograd.numpy as np #%% Kernel operations # Returns the norm of the pairwise difference def norm_matrix(matrix_1, matrix_2): norm_square_1 = np.sum(np.square(matrix_1), axis = 1) norm_square_1 = np.reshape(norm_square_...
en
0.693249
# -*- coding: utf-8 -*- Created on Wed Jul 22 14:36:48 2020 @author: matth #%% Kernel operations # Returns the norm of the pairwise difference # Returns the pairwise inner product
3.228686
3
cors/resources/cors-makeheader.py
meyerweb/wpt
14,668
4186
import json from wptserve.utils import isomorphic_decode def main(request, response): origin = request.GET.first(b"origin", request.headers.get(b'origin') or b'none') if b"check" in request.GET: token = request.GET.first(b"token") value = request.server.stash.take(token) if value is n...
import json from wptserve.utils import isomorphic_decode def main(request, response): origin = request.GET.first(b"origin", request.headers.get(b'origin') or b'none') if b"check" in request.GET: token = request.GET.first(b"token") value = request.server.stash.take(token) if value is n...
en
0.955822
#Preflight #Override the response code if we're in a preflight and it's asked #Log that the preflight actually happened if we have an ident #I have no idea, really
2.259131
2
device_osc_grid.py
wlfyit/PiLightsLib
0
4187
<reponame>wlfyit/PiLightsLib #!/usr/bin/env python3 from pythonosc import osc_bundle_builder from pythonosc import osc_message_builder from pythonosc import udp_client from .device import DeviceObj # OSC Grid Object class OSCGrid(DeviceObj): def __init__(self, name, width, height, ip, port, bri=1): Devic...
#!/usr/bin/env python3 from pythonosc import osc_bundle_builder from pythonosc import osc_message_builder from pythonosc import udp_client from .device import DeviceObj # OSC Grid Object class OSCGrid(DeviceObj): def __init__(self, name, width, height, ip, port, bri=1): DeviceObj.__init__(self, name, "os...
en
0.206855
#!/usr/bin/env python3 # OSC Grid Object # Set Pixel # Update Display
2.414854
2
main/models.py
StevenSume/EasyCMDB
2
4188
from .app import db class Project(db.Model): __tablename__ = 'projects' id = db.Column(db.Integer,primary_key=True,autoincrement=True) project_name = db.Column(db.String(64),unique=True,index=True) def to_dict(self): mydict = { 'id': self.id, 'project_name': self.projec...
from .app import db class Project(db.Model): __tablename__ = 'projects' id = db.Column(db.Integer,primary_key=True,autoincrement=True) project_name = db.Column(db.String(64),unique=True,index=True) def to_dict(self): mydict = { 'id': self.id, 'project_name': self.projec...
none
1
2.817086
3
test.py
iron-io/iron_cache_python
3
4189
<reponame>iron-io/iron_cache_python<gh_stars>1-10 from iron_cache import * import unittest import requests class TestIronCache(unittest.TestCase): def setUp(self): self.cache = IronCache("test_cache") def test_get(self): self.cache.put("test_item", "testing") item = self.cache.get("te...
from iron_cache import * import unittest import requests class TestIronCache(unittest.TestCase): def setUp(self): self.cache = IronCache("test_cache") def test_get(self): self.cache.put("test_item", "testing") item = self.cache.get("test_item") self.assertEqual(item.value, "te...
none
1
2.751748
3
lib_exec/StereoPipeline/libexec/asp_image_utils.py
sebasmurphy/iarpa
20
4190
#!/usr/bin/env python # -*- coding: utf-8 -*- # __BEGIN_LICENSE__ # Copyright (c) 2009-2013, United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. All # rights reserved. # # The NGT platform is licensed under the Apache License, Version 2.0 (the # "Lic...
#!/usr/bin/env python # -*- coding: utf-8 -*- # __BEGIN_LICENSE__ # Copyright (c) 2009-2013, United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. All # rights reserved. # # The NGT platform is licensed under the Apache License, Version 2.0 (the # "Lic...
en
0.86073
#!/usr/bin/env python # -*- coding: utf-8 -*- # __BEGIN_LICENSE__ # Copyright (c) 2009-2013, United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. All # rights reserved. # # The NGT platform is licensed under the Apache License, Version 2.0 (the # "Lic...
2.589201
3
src/sv-pipeline/04_variant_resolution/scripts/merge_RdTest_genotypes.py
leipzig/gatk-sv
76
4191
#!/usr/bin/env python import argparse DELIMITER = "\t" def merge(genotypes_filename, gq_filename, merged_filename): with open(genotypes_filename, "r") as genotypes, open(gq_filename, "r") as gq, open(merged_filename, "w") as merged: # Integrity check: do the files have same columns? genotypes_...
#!/usr/bin/env python import argparse DELIMITER = "\t" def merge(genotypes_filename, gq_filename, merged_filename): with open(genotypes_filename, "r") as genotypes, open(gq_filename, "r") as gq, open(merged_filename, "w") as merged: # Integrity check: do the files have same columns? genotypes_...
en
0.704811
#!/usr/bin/env python # Integrity check: do the files have same columns? # Check if lines in the files are in the correct order.
3.101818
3
esperanto_analyzer/web/__init__.py
fidelisrafael/esperanto-analyzer
18
4192
<gh_stars>10-100 from .api.server import run_app
from .api.server import run_app
none
1
1.081698
1
crawling/sns/main.py
CSID-DGU/2021-2-OSSP2-TwoRolless-2
0
4193
import tweepy import traceback import time import pymongo from tweepy import OAuthHandler from pymongo import MongoClient from pymongo.cursor import CursorType twitter_consumer_key = "" twitter_consumer_secret = "" twitter_access_token = "" twitter_access_secret = "" auth = OAuthHandler(twitter_consumer_key, twitter_...
import tweepy import traceback import time import pymongo from tweepy import OAuthHandler from pymongo import MongoClient from pymongo.cursor import CursorType twitter_consumer_key = "" twitter_consumer_secret = "" twitter_access_token = "" twitter_access_secret = "" auth = OAuthHandler(twitter_consumer_key, twitter_...
none
1
2.758263
3
demos/interactive-classifier/config.py
jepabe/Demo_earth2
1,909
4194
#!/usr/bin/env python """Handles Earth Engine service account configuration.""" import ee # The service account email address authorized by your Google contact. # Set up a service account as described in the README. EE_ACCOUNT = '<EMAIL>' # The private key associated with your service account in Privacy Enhanced # E...
#!/usr/bin/env python """Handles Earth Engine service account configuration.""" import ee # The service account email address authorized by your Google contact. # Set up a service account as described in the README. EE_ACCOUNT = '<EMAIL>' # The private key associated with your service account in Privacy Enhanced # E...
en
0.699286
#!/usr/bin/env python Handles Earth Engine service account configuration. # The service account email address authorized by your Google contact. # Set up a service account as described in the README. # The private key associated with your service account in Privacy Enhanced # Email format (.pem suffix). To convert a p...
1.922163
2
PythonScripting/NumbersInPython.py
Neo-sunny/pythonProgs
0
4195
""" Demonstration of numbers in Python """ # Python has an integer type called int print("int") print("---") print(0) print(1) print(-3) print(70383028364830) print("") # Python has a real number type called float print("float") print("-----") print(0.0) print(7.35) print(-43.2) print("") # Limited precision print...
""" Demonstration of numbers in Python """ # Python has an integer type called int print("int") print("---") print(0) print(1) print(-3) print(70383028364830) print("") # Python has a real number type called float print("float") print("-----") print(0.0) print(7.35) print(-43.2) print("") # Limited precision print...
en
0.80612
Demonstration of numbers in Python # Python has an integer type called int # Python has a real number type called float # Limited precision # Scientific/exponential notation # Infinity # Conversions Demonstration of simple arithmetic expressions in Python # Unary + and - # Simple arithmetic Demonstration of compound ar...
4.211288
4
3DBeam/source/solving_strategies/strategies/linear_solver.py
JoZimmer/Beam-Models
0
4196
from source.solving_strategies.strategies.solver import Solver class LinearSolver(Solver): def __init__(self, array_time, time_integration_scheme, dt, comp_model, initial_conditions, force, structure_model): super().__ini...
from source.solving_strategies.strategies.solver import Solver class LinearSolver(Solver): def __init__(self, array_time, time_integration_scheme, dt, comp_model, initial_conditions, force, structure_model): super().__ini...
en
0.749598
# time loop #print("time: {0:.2f}".format(current_time)) # appending results to the list # TODO: only calculate reaction when user wants it # if self.structure_model is not None: # self.dynamic_reaction[:, i] = self._compute_reaction() # reaction computed in dynamic analysis # TODO: only calculate reaction when use...
3.2107
3
payment/migrations/0002_auto_20171125_0022.py
Littledelma/mofadog
0
4197
<gh_stars>0 # -*- coding: utf-8 -*- # Generated by Django 1.11.7 on 2017-11-24 16:22 from __future__ import unicode_literals import datetime from django.db import migrations, models from django.utils.timezone import utc class Migration(migrations.Migration): dependencies = [ ('payment', '0001_initial'),...
# -*- coding: utf-8 -*- # Generated by Django 1.11.7 on 2017-11-24 16:22 from __future__ import unicode_literals import datetime from django.db import migrations, models from django.utils.timezone import utc class Migration(migrations.Migration): dependencies = [ ('payment', '0001_initial'), ] ...
en
0.734987
# -*- coding: utf-8 -*- # Generated by Django 1.11.7 on 2017-11-24 16:22
1.818069
2
src/sqlfluff/rules/L024.py
NathanHowell/sqlfluff
3,024
4198
<gh_stars>1000+ """Implementation of Rule L024.""" from sqlfluff.core.rules.doc_decorators import document_fix_compatible from sqlfluff.rules.L023 import Rule_L023 @document_fix_compatible class Rule_L024(Rule_L023): """Single whitespace expected after USING in JOIN clause. | **Anti-pattern** .. code-...
"""Implementation of Rule L024.""" from sqlfluff.core.rules.doc_decorators import document_fix_compatible from sqlfluff.rules.L023 import Rule_L023 @document_fix_compatible class Rule_L024(Rule_L023): """Single whitespace expected after USING in JOIN clause. | **Anti-pattern** .. code-block:: sql ...
en
0.502913
Implementation of Rule L024. Single whitespace expected after USING in JOIN clause. | **Anti-pattern** .. code-block:: sql SELECT b FROM foo LEFT JOIN zoo USING(a) | **Best practice** | The • character represents a space. | Add a space after USING, to avoid confusing it ...
1.78243
2
projects/scocen/cmd_components_simple.py
mikeireland/chronostar
4
4199
<reponame>mikeireland/chronostar """ Plot CMDs for each component. """ import numpy as np from astropy.table import Table import matplotlib.pyplot as plt import matplotlib.cm as cm plt.ion() # Pretty plots from fig_settings import * ############################################ # Some things are the same for all the ...
""" Plot CMDs for each component. """ import numpy as np from astropy.table import Table import matplotlib.pyplot as plt import matplotlib.cm as cm plt.ion() # Pretty plots from fig_settings import * ############################################ # Some things are the same for all the plotting scripts and we put # thi...
en
0.270203
Plot CMDs for each component. # Pretty plots ############################################ # Some things are the same for all the plotting scripts and we put # this into a single library to avoid confusion. ############################################ # Minimal probability required for membership #######################...
2.365937
2