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
dnd.py
josephcslater/Do-Not-DIsturb
2
6625351
<filename>dnd.py #! /Users/jslater/anaconda3/bin/python # $Id: dnd.py 2015-04-27 19:05:00Z $ # Author: <NAME> <<EMAIL>> # Copyright: This script has been placed in the public domain. # Version 1.2: Added help via --help and -h # Version 1.1: Added ability to set by time. import sys import os import subprocess import ...
<filename>dnd.py #! /Users/jslater/anaconda3/bin/python # $Id: dnd.py 2015-04-27 19:05:00Z $ # Author: <NAME> <<EMAIL>> # Copyright: This script has been placed in the public domain. # Version 1.2: Added help via --help and -h # Version 1.1: Added ability to set by time. import sys import os import subprocess import ...
en
0.796274
#! /Users/jslater/anaconda3/bin/python # $Id: dnd.py 2015-04-27 19:05:00Z $ # Author: <NAME> <<EMAIL>> # Copyright: This script has been placed in the public domain. # Version 1.2: Added help via --help and -h # Version 1.1: Added ability to set by time. Change Notification Center status on Mac to "Do not disturb" for...
2.25917
2
scripts_vcoco/models/model.py
perryshao/MSRefNet
0
6625352
<filename>scripts_vcoco/models/model.py<gh_stars>0 # coding=utf-8 from __future__ import print_function, division import torch import torch.nn as nn import sys sys.path.append("..") import utils.pool_pairing as ROI import torchvision.models as models lin_size = 1024 ids = 80 context_size = 1024 sp_size = 1024 mul = 3...
<filename>scripts_vcoco/models/model.py<gh_stars>0 # coding=utf-8 from __future__ import print_function, division import torch import torch.nn as nn import sys sys.path.append("..") import utils.pool_pairing as ROI import torchvision.models as models lin_size = 1024 ids = 80 context_size = 1024 sp_size = 1024 mul = 3...
de
0.640296
# coding=utf-8 ## Resnets,resnext ######### Convolutional Blocks for human,objects and the context############################## ############################################################################################### ##### Attention Feature Model###### # nn.Conv2d(2, 64, kernel_size=(5, 5)), # nn.Linear(32,1024...
2.105837
2
pinax/projects/intranet_project/apps/intranet_account/urls.py
keimlink/pinax
2
6625353
from django.conf.urls.defaults import * from intranet_account.forms import * urlpatterns = patterns('', url(r'^email/$', 'intranet_account.views.email', name="acct_email"), url(r'^login/$', 'intranet_account.views.login', name="acct_login"), url(r'^password_change/$', 'intranet_account.views.password_chang...
from django.conf.urls.defaults import * from intranet_account.forms import * urlpatterns = patterns('', url(r'^email/$', 'intranet_account.views.email', name="acct_email"), url(r'^login/$', 'intranet_account.views.login', name="acct_login"), url(r'^password_change/$', 'intranet_account.views.password_chang...
en
0.281181
# ajax validation
1.76271
2
congress/api/table_model.py
poobalan-arumugam/congress
0
6625354
<gh_stars>0 # Copyright (c) 2014 VMware, Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unles...
# Copyright (c) 2014 VMware, Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
en
0.740967
# Copyright (c) 2014 VMware, Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
1.893083
2
tests/test_parsers.py
MadSciSoCool/zhinst-toolkit
0
6625355
import pytest from hypothesis import given, assume, strategies as st from hypothesis.stateful import rule, precondition, RuleBasedStateMachine import numpy as np from .context import Parse @given(st.integers(0, 5)) def test_set_on_off(n): map = {0: "off", 1: "on", 2: "OFF", 3: "ON", 4: 0, 5: 1} val = Parse.s...
import pytest from hypothesis import given, assume, strategies as st from hypothesis.stateful import rule, precondition, RuleBasedStateMachine import numpy as np from .context import Parse @given(st.integers(0, 5)) def test_set_on_off(n): map = {0: "off", 1: "on", 2: "OFF", 3: "ON", 4: 0, 5: 1} val = Parse.s...
none
1
2.217068
2
tests/models_tests/test_weavenet.py
pfnet/chainerchem
184
6625356
from chainer import cuda from chainer import gradient_check import numpy import pytest from chainer_chemistry.config import MAX_ATOMIC_NUM from chainer_chemistry.models.weavenet import WeaveNet from chainer_chemistry.utils.permutation import permute_adj from chainer_chemistry.utils.permutation import permute_node ato...
from chainer import cuda from chainer import gradient_check import numpy import pytest from chainer_chemistry.config import MAX_ATOMIC_NUM from chainer_chemistry.models.weavenet import WeaveNet from chainer_chemistry.utils.permutation import permute_adj from chainer_chemistry.utils.permutation import permute_node ato...
en
0.405498
model to test `atom_data_processed` input # adj_data is symmetric along pair of atoms # adj_data = adj_data + adj_data.swapaxes(-1, -2)
2.004138
2
metricbeat/tests/system/test_autodiscover.py
IzekChen/beats
8
6625357
import os import metricbeat import unittest from time import sleep from beat.beat import INTEGRATION_TESTS class TestAutodiscover(metricbeat.BaseTest): """ Test metricbeat autodiscover """ @unittest.skipIf(not INTEGRATION_TESTS or os.getenv("TESTING_ENVIRONMENT") == "2x", ...
import os import metricbeat import unittest from time import sleep from beat.beat import INTEGRATION_TESTS class TestAutodiscover(metricbeat.BaseTest): """ Test metricbeat autodiscover """ @unittest.skipIf(not INTEGRATION_TESTS or os.getenv("TESTING_ENVIRONMENT") == "2x", ...
en
0.407109
Test metricbeat autodiscover Test docker autodiscover starts modules from templates - condition: equals.docker.container.image: memcached:latest config: - module: memcached metricsets: ["stats"] ...
2.163267
2
tests/bdd/steps/assertions.py
GQMai/mbed-cloud-sdk-python
12
6625358
import ast import behave from tests.bdd.steps.common import operator_compare from tests.bdd.steps.common import is_equal @behave.then("{name} object is {operator} {other_name}") def assert_entity(context, name, operator, other_name): first = context.entities[name] second = context.entities[other_name] o...
import ast import behave from tests.bdd.steps.common import operator_compare from tests.bdd.steps.common import is_equal @behave.then("{name} object is {operator} {other_name}") def assert_entity(context, name, operator, other_name): first = context.entities[name] second = context.entities[other_name] o...
none
1
2.633774
3
Data/Extraction/import.py
RohanMathur17/Song-Clustering
0
6625359
<reponame>RohanMathur17/Song-Clustering import spotipy import spotipy.util as util from spotipy import oauth2 import pandas as pd client_id = 'XXX' client_secret = 'XXX' token = oauth2.SpotifyClientCredentials(client_id = client_id , client_secret = client_secret) cache_token = token.get_access_token() sp ...
import spotipy import spotipy.util as util from spotipy import oauth2 import pandas as pd client_id = 'XXX' client_secret = 'XXX' token = oauth2.SpotifyClientCredentials(client_id = client_id , client_secret = client_secret) cache_token = token.get_access_token() sp = spotipy.Spotify(cache_token) ...
en
0.849783
# Create empty dataframe # Loop through every track in the playlist, extract features and append the features to the playlist df # Create empty dict # Get metadata # Get audio features # Concat the dfs
3.282596
3
dsa/data_structures/hashtable/hashtable.py
joseph-zabaleta/data-structures-and-algorithms
0
6625360
<gh_stars>0 class Node: def __init__(self, data): self.data = data self.next = None class LinkedList: def __init__(self): self.head = None def add(self, data): node = Node(data) if not self.head: self.head = node else: current = self...
class Node: def __init__(self, data): self.data = data self.next = None class LinkedList: def __init__(self): self.head = None def add(self, data): node = Node(data) if not self.head: self.head = node else: current = self.head ...
en
0.895849
This class is used to implement a hashmap It has four available methods: Add, Get, Contains, Hash Add is reponsible for adding data to the hashmap datas structure Get is responsible for taking in a key argument and returning the value for that key in the hashmap Contains is reponsible for returning a bool for wethe...
4.176287
4
java/iotivity-android/run_android_smoketests.py
jongsunglee/test_iotivity
4
6625361
<gh_stars>1-10 #!/usr/bin/python #****************************************************************** # # Copyright 2016 Intel Corporation All Rights Reserved. # #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this f...
#!/usr/bin/python #****************************************************************** # # Copyright 2016 Intel Corporation All Rights Reserved. # #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in c...
en
0.699604
#!/usr/bin/python #****************************************************************** # # Copyright 2016 Intel Corporation All Rights Reserved. # #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in co...
2.328809
2
src/biome/text/environment.py
ignacioct/biome-text
0
6625362
<reponame>ignacioct/biome-text<filename>src/biome/text/environment.py<gh_stars>0 CUDA_DEVICE = "CUDA_DEVICE"
CUDA_DEVICE = "CUDA_DEVICE"
none
1
1.056024
1
apple/bundling/plist_actions.bzl
jerrymarino/rules_apple
1
6625363
# Copyright 2017 The Bazel Authors. 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 la...
# Copyright 2017 The Bazel Authors. 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 la...
en
0.833138
# Copyright 2017 The Bazel Authors. 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 la...
1.553267
2
scripts/vae/utils/plot.py
qiuhuachuan/pyprobml
0
6625364
<reponame>qiuhuachuan/pyprobml import matplotlib.pyplot as plt import torchvision.utils as vutils from einops import rearrange def plot(model_samples, title, figsize=(10,30), num_of_images_per_row=5): plt.figure(figsize=figsize) img1 = vutils.make_grid(model_samples, nrow=num_of_images_per_row).cpu().detach()....
import matplotlib.pyplot as plt import torchvision.utils as vutils from einops import rearrange def plot(model_samples, title, figsize=(10,30), num_of_images_per_row=5): plt.figure(figsize=figsize) img1 = vutils.make_grid(model_samples, nrow=num_of_images_per_row).cpu().detach().numpy() plt.title(title) ...
none
1
2.412701
2
simple_rl/amdp/abstr_domains/cleanup/AbstractCleanupMDPClass.py
yoonseon-oh/simple_rl
2
6625365
# Python imports from __future__ import print_function from collections import defaultdict import copy # Other imports from simple_rl.mdp.MDPClass import MDP from simple_rl.planning import ValueIteration from simple_rl.amdp.AMDPTaskNodesClass import NonPrimitiveAbstractTask, RootTaskNode from simple_rl.amdp.abstr_doma...
# Python imports from __future__ import print_function from collections import defaultdict import copy # Other imports from simple_rl.mdp.MDPClass import MDP from simple_rl.planning import ValueIteration from simple_rl.amdp.AMDPTaskNodesClass import NonPrimitiveAbstractTask, RootTaskNode from simple_rl.amdp.abstr_doma...
en
0.65893
# Python imports # Other imports Args: l1_action_string (str) subtasks (list) l0_domain (CleanUpMDP) Args: state (CleanUpState) Returns: is_terminal (bool) # ------------------------------- # L1 Action Helper Functions # ------------------------------...
2.037
2
Codes/Day-057/blog/main.py
MdGhulamAzadAnsari/100-Days-of-Code
3
6625366
from flask import Flask, render_template from post import Post import requests posts = requests.get("https://api.npoint.io/5abcca6f4e39b4955965").json() post_objects = [] for post in posts: post_obj = Post(post["id"], post["title"], post["subtitle"], post["body"]) post_objects.append(post_obj) app = Flask(__...
from flask import Flask, render_template from post import Post import requests posts = requests.get("https://api.npoint.io/5abcca6f4e39b4955965").json() post_objects = [] for post in posts: post_obj = Post(post["id"], post["title"], post["subtitle"], post["body"]) post_objects.append(post_obj) app = Flask(__...
none
1
2.935647
3
back-flask/api/user.py
LukasL97/shop-4-me
0
6625367
<reponame>LukasL97/shop-4-me<filename>back-flask/api/user.py from flask import request, Response, make_response from api.http_status import OK, BAD_REQUEST, NOT_FOUND, UNAUTHORIZED, CONFLICT, UNPROCESSABLE_ENTITY from model.exception import UnexpectedUserTypeError, UserNotFoundError, IncorrectPasswordError, \ Use...
from flask import request, Response, make_response from api.http_status import OK, BAD_REQUEST, NOT_FOUND, UNAUTHORIZED, CONFLICT, UNPROCESSABLE_ENTITY from model.exception import UnexpectedUserTypeError, UserNotFoundError, IncorrectPasswordError, \ UserAlreadyRegisteredError, UserSessionIdNotFoundError, Unexpecte...
en
0.759783
--- post: summary: login a user requestBody: required: true content: application/json: schema: type: object properties: userType: ty...
2.781923
3
2020/15.py
KarboniteKream/aoc-2020
1
6625368
<reponame>KarboniteKream/aoc-2020 import util def speak(numbers, target): *spoken, last = numbers spoken = {num: idx for idx, num in enumerate(spoken)} for turn in range(len(numbers), target): if last not in spoken: curr = 0 else: curr = turn - 1 - spoken[last] ...
import util def speak(numbers, target): *spoken, last = numbers spoken = {num: idx for idx, num in enumerate(spoken)} for turn in range(len(numbers), target): if last not in spoken: curr = 0 else: curr = turn - 1 - spoken[last] spoken[last] = turn - 1 ...
none
1
3.406014
3
src/train.py
aadithyamd/BertSum
0
6625369
#!/usr/bin/env python """ Main training workflow """ from __future__ import division import argparse import glob import os import random import signal import time import torch from pytorch_pretrained_bert import BertConfig import distributed from models import data_loader, model_builder from models.data_loader i...
#!/usr/bin/env python """ Main training workflow """ from __future__ import division import argparse import glob import os import random import signal import time import torch from pytorch_pretrained_bert import BertConfig import distributed from models import data_loader, model_builder from models.data_loader i...
en
0.768783
#!/usr/bin/env python Main training workflow Spawns 1 process per GPU # Create a thread to listen for errors in the child processes. # Train with multiprocessing. run process # killed by parent, do nothing # propagate exception to parent process, keeping original traceback A class that listens for exceptions in childre...
2.196675
2
hardware/ayam/pusher.py
haziquehaikal/smartdb
0
6625370
<reponame>haziquehaikal/smartdb<gh_stars>0 from pysher.channel import Channel from pysher.connection import Connection import hashlib import hmac import logging import json VERSION = '0.6.0' class Pusher(object): host = "ws.pusherapp.com" client_id = "Pysher" protocol = 6 def __init__(self, key, clu...
from pysher.channel import Channel from pysher.connection import Connection import hashlib import hmac import logging import json VERSION = '0.6.0' class Pusher(object): host = "ws.pusherapp.com" client_id = "Pysher" protocol = 6 def __init__(self, key, cluster="", secure=True, secret="", user_data=...
en
0.681441
Initialize the Pusher instance. :param str or bytes key: :param str cluster: :param bool secure: :param bytes or str secret: :param Optional[Dict] user_data: :param str log_level: :param bool daemon: :param int port: :param int or float reconnect_...
2.668261
3
web_crawler/__init__.py
tul1/py-webcrawler
0
6625371
""" Top level package for the py-webcrawler """ __author__ = """ <NAME> """ __version__ = '0.1.0' from web_crawler.web_crawler import WebCrawler from web_crawler.web_crawler_async import WebCrawlerAsync __all__ = ['WebCrawler', 'WebCrawlerAsync']
""" Top level package for the py-webcrawler """ __author__ = """ <NAME> """ __version__ = '0.1.0' from web_crawler.web_crawler import WebCrawler from web_crawler.web_crawler_async import WebCrawlerAsync __all__ = ['WebCrawler', 'WebCrawlerAsync']
en
0.63205
Top level package for the py-webcrawler <NAME>
1.460335
1
buildingspy/io/__init__.py
wanaylor/NewBuildingsPy
1
6625372
''' This module contains the classes - *Reader* that can be used to read ``*.mat`` files that have been generated by Dymola, - *Reporter* that can be used to report to the standard output and standard error streams, and - *Plotter* that contains method to plot results. '''
''' This module contains the classes - *Reader* that can be used to read ``*.mat`` files that have been generated by Dymola, - *Reporter* that can be used to report to the standard output and standard error streams, and - *Plotter* that contains method to plot results. '''
en
0.915045
This module contains the classes - *Reader* that can be used to read ``*.mat`` files that have been generated by Dymola, - *Reporter* that can be used to report to the standard output and standard error streams, and - *Plotter* that contains method to plot results.
1.398479
1
valhalla/_transform.py
Best10-study/Kakao-Valhalla
10
6625373
import numpy as np import pandas as pd from scipy import sparse from sklearn.base import TransformerMixin from sklearn.utils import Parallel, delayed from sklearn.utils.metaestimators import _BaseComposition class FeatureConcat(_BaseComposition, TransformerMixin): """Concatenates results of multiple transformer o...
import numpy as np import pandas as pd from scipy import sparse from sklearn.base import TransformerMixin from sklearn.utils import Parallel, delayed from sklearn.utils.metaestimators import _BaseComposition class FeatureConcat(_BaseComposition, TransformerMixin): """Concatenates results of multiple transformer o...
en
0.621071
Concatenates results of multiple transformer objects. FeatureUnion는 결과를 hstack해버리기 때문에, return의 shape가 [batch_size*feature_num,0]으로 나온다. 내가 원하는 return의 shape은 (batch_size, feature_num)으로 고치고 싶다. sklearn. Parameters ---------- transformer_list : list of (string, transformer) tuples List...
2.558154
3
examples/milestone_add_with_submilestone.py
levi-rs/testrail-api-wrapper
2
6625374
from datetime import datetime as dt import traw def main(): client = traw.Client() # Credentials loaded through ENV vars # Locate the project you will be adding milestones to project = client.project(15) # Create the parent milestone new_parent_ms = client.milestone() # Creates a new, empty m...
from datetime import datetime as dt import traw def main(): client = traw.Client() # Credentials loaded through ENV vars # Locate the project you will be adding milestones to project = client.project(15) # Create the parent milestone new_parent_ms = client.milestone() # Creates a new, empty m...
en
0.8101
# Credentials loaded through ENV vars # Locate the project you will be adding milestones to # Create the parent milestone # Creates a new, empty milestone object # Start on 2018/01/01 # Due on 2018/12/31 # Associate this milestone with a project # Add the new milestone to TestRail, replacing it with the Milestone retur...
2.513301
3
forte/data/readers/tests/conllu_ud_reader_test.py
mgupta1410/forte-1
0
6625375
""" Tests for conllU reader """ import os import unittest from typing import List from ft.onto.base_ontology import Sentence, Document, Dependency from forte.data.readers import ConllUDReader from forte.data.data_pack import DataPack class ConllUDReaderTest(unittest.TestCase): def setUp(self): """ ...
""" Tests for conllU reader """ import os import unittest from typing import List from ft.onto.base_ontology import Sentence, Document, Dependency from forte.data.readers import ConllUDReader from forte.data.data_pack import DataPack class ConllUDReaderTest(unittest.TestCase): def setUp(self): """ ...
en
0.824402
Tests for conllU reader Reading the data into data_pack object to be used in the tests Returns the root token of the dependency tree. Args: link: The intermediate dependency link. data_pack: The data pack to be worked on. Returns: # TODO: make it robust enough to handle cycles for enhanced ...
2.629621
3
src/penn_chime/validators/validators.py
covidcaremap/chime
222
6625376
"""design pattern via https://youtu.be/S_ipdVNSFlo?t=2153""" from typing import Optional from datetime import date from .base import Validator EPSILON = 1.e-7 class OptionalValue(Validator): """Any value at all""" def __init__(self) -> None: pass def validate(self, key, value): pass ...
"""design pattern via https://youtu.be/S_ipdVNSFlo?t=2153""" from typing import Optional from datetime import date from .base import Validator EPSILON = 1.e-7 class OptionalValue(Validator): """Any value at all""" def __init__(self) -> None: pass def validate(self, key, value): pass ...
en
0.685148
design pattern via https://youtu.be/S_ipdVNSFlo?t=2153 Any value at all A bounded number. This method implicitly validates isinstance(value, (float, int)) because it will throw a TypeError on comparison a bounded number or a None. A rate in [0,1]. A date.
3.545602
4
morphomath1.0.py
KiliBio/MorphoMath
0
6625377
#!/usr/bin/python ''' Code written in Python 3.5 by KiliBio ''' ''' Missions accomplished: General design ✓ Point-specific mode ✓ Ratio-specific mode Angle-specific mode Area-specific mode all to log_file ✓ ''' import tkinter as tk import tkinter.messagebox import csv from tkin...
#!/usr/bin/python ''' Code written in Python 3.5 by KiliBio ''' ''' Missions accomplished: General design ✓ Point-specific mode ✓ Ratio-specific mode Angle-specific mode Area-specific mode all to log_file ✓ ''' import tkinter as tk import tkinter.messagebox import csv from tkin...
en
0.839035
#!/usr/bin/python Code written in Python 3.5 by KiliBio Missions accomplished: General design ✓ Point-specific mode ✓ Ratio-specific mode Angle-specific mode Area-specific mode all to log_file ✓ # the MorphoMath class inherits from the Tk class in the tk module # the init function accepts ...
2.858919
3
venv/lib/python2.7/site-packages/telegram/bot.py
kennethcyh/Secret-Santa-Bot
0
6625378
<filename>venv/lib/python2.7/site-packages/telegram/bot.py #!/usr/bin/env python # -*- coding: utf-8 -*- # pylint: disable=E0611,E0213,E1102,C0103,E1101,W0613,R0913,R0904 # # A library that provides a Python interface to the Telegram Bot API # Copyright (C) 2015-2018 # <NAME> <<EMAIL>> # # This program is free software...
<filename>venv/lib/python2.7/site-packages/telegram/bot.py #!/usr/bin/env python # -*- coding: utf-8 -*- # pylint: disable=E0611,E0213,E1102,C0103,E1101,W0613,R0913,R0904 # # A library that provides a Python interface to the Telegram Bot API # Copyright (C) 2015-2018 # <NAME> <<EMAIL>> # # This program is free software...
en
0.704532
#!/usr/bin/env python # -*- coding: utf-8 -*- # pylint: disable=E0611,E0213,E1102,C0103,E1101,W0613,R0913,R0904 # # A library that provides a Python interface to the Telegram Bot API # Copyright (C) 2015-2018 # <NAME> <<EMAIL>> # # This program is free software: you can redistribute it and/or modify # it under the term...
1.906595
2
test/connectivity/acts/tests/google/wifi/WifiPnoTest.py
Keneral/atools
0
6625379
# # Copyright 2014 - The Android Open Source Project # # 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...
# # Copyright 2014 - The Android Open Source Project # # 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.834798
# # Copyright 2014 - The Android Open Source Project # # 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.968906
2
for-ncclient/rpc.py
HPENetworking/hpe-cw7-ansible
4
6625380
# Copyright 2009 <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 applicable law or agreed to in writing, softwa...
# Copyright 2009 <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 applicable law or agreed to in writing, softwa...
en
0.805149
# Copyright 2009 <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 applicable law or agreed to in writing, softwa...
1.876153
2
compound_poisson/forecast/time_series.py
shermanlo77/cptimeseries
3
6625381
"""Forecaster implementation for TimeSeries. Contain the classes compound_poisson.forecast.time_series.Forecaster compound_poisson.forecast.time_series.SelfForecaster compound_poisson.forecast.forecast_abstract.Forecaster <- compound_poisson.forecast.time_series.Forecaster <- compound_poisson.forec...
"""Forecaster implementation for TimeSeries. Contain the classes compound_poisson.forecast.time_series.Forecaster compound_poisson.forecast.time_series.SelfForecaster compound_poisson.forecast.forecast_abstract.Forecaster <- compound_poisson.forecast.time_series.Forecaster <- compound_poisson.forec...
en
0.783927
Forecaster implementation for TimeSeries. Contain the classes compound_poisson.forecast.time_series.Forecaster compound_poisson.forecast.time_series.SelfForecaster compound_poisson.forecast.forecast_abstract.Forecaster <- compound_poisson.forecast.time_series.Forecaster <- compound_poisson.forecast...
2.522815
3
codonPython/tests/suppression_test.py
wthirskgaskill/codonPython
1
6625382
from codonPython.suppression import suppress_value import pytest @pytest.mark.parametrize("to_suppress, expected", [ (0, "0"), (2, "*"), (5, "*"), (8, "10"), (16, "15"), (57, "55"), (10023, "10025") ]) def test_suppress_value_BAU(to_suppress, expected): assert expected == suppress_valu...
from codonPython.suppression import suppress_value import pytest @pytest.mark.parametrize("to_suppress, expected", [ (0, "0"), (2, "*"), (5, "*"), (8, "10"), (16, "15"), (57, "55"), (10023, "10025") ]) def test_suppress_value_BAU(to_suppress, expected): assert expected == suppress_valu...
none
1
2.441235
2
peering/models/models.py
routerfixer/peering-manager
0
6625383
<gh_stars>0 import ipaddress import logging import napalm from cacheops import cached_as from django.conf import settings from django.db import models, transaction from django.db.models import Q from django.urls import reverse from django.utils import timezone from django.utils.safestring import mark_safe from netfiel...
import ipaddress import logging import napalm from cacheops import cached_as from django.conf import settings from django.db import models, transaction from django.db.models import Q from django.urls import reverse from django.utils import timezone from django.utils.safestring import mark_safe from netfields import In...
en
0.854915
Returns all direct peering sessions with this AS. Returns all IXP peering sessions with this AS. Returns all IXPs this AS is peering on (with us). Returns all IXPs this AS has with the other one. Returns all missing peering sessions between this AS and the other one on a given IXP. As we are relying on PeeringD...
1.579162
2
tests/test_logging.py
k-dominik/pytest-qt
0
6625384
import datetime import pytest from pytestqt.qt_compat import qt_api @pytest.mark.parametrize("test_succeeds", [True, False]) @pytest.mark.parametrize("qt_log", [True, False]) def test_basic_logging(testdir, test_succeeds, qt_log): """ Test Qt logging capture output. :type testdir: _pytest.pytester.TmpT...
import datetime import pytest from pytestqt.qt_compat import qt_api @pytest.mark.parametrize("test_succeeds", [True, False]) @pytest.mark.parametrize("qt_log", [True, False]) def test_basic_logging(testdir, test_succeeds, qt_log): """ Test Qt logging capture output. :type testdir: _pytest.pytester.TmpT...
en
0.492985
Test Qt logging capture output. :type testdir: _pytest.pytester.TmpTestdir import sys from pytestqt.qt_compat import qt_api def to_unicode(s): return s.decode('utf-8', 'replace') if isinstance(s, bytes) else s if qt_api.qInstallMessageHandler: def print_msg(msg_typ...
2.174088
2
scan/fetchers/kube/kube_fetch_oteps_vpp.py
korenlev/calipso-cvim
0
6625385
############################################################################### # Copyright (c) 2017-2020 <NAME> (Cisco Systems), # # <NAME> (Cisco Systems), <NAME> (Cisco Systems) and others # # # # All rights r...
############################################################################### # Copyright (c) 2017-2020 <NAME> (Cisco Systems), # # <NAME> (Cisco Systems), <NAME> (Cisco Systems) and others # # # # All rights r...
en
0.431477
############################################################################### # Copyright (c) 2017-2020 <NAME> (Cisco Systems), # # <NAME> (Cisco Systems), <NAME> (Cisco Systems) and others # # # # All rights r...
2.075571
2
model_innondations/pipeline/download-climateknowledgeportal.py
PayjPan/batch8_worldbank
0
6625386
<gh_stars>0 # -*- coding: utf-8 -*- import requests import os, sys import pandas as pd import urllib.parse import logging #import asyncio import concurrent.futures from pathlib import Path ''' Script to download dataset from https://climateknowledgeportal.worldbank.org/api/data/get-download-data ''' DATASET_FOLDER = '....
# -*- coding: utf-8 -*- import requests import os, sys import pandas as pd import urllib.parse import logging #import asyncio import concurrent.futures from pathlib import Path ''' Script to download dataset from https://climateknowledgeportal.worldbank.org/api/data/get-download-data ''' DATASET_FOLDER = '../../dataset...
en
0.405887
# -*- coding: utf-8 -*- #import asyncio Script to download dataset from https://climateknowledgeportal.worldbank.org/api/data/get-download-data # Destination # Read countries list Pour la construire : https://climateknowledgeportal.worldbank.org/api/data/get-download-data / projection/historical (2 options) / mavg/mano...
2.699917
3
src/functions.py
gsc2001/ConvexNet
0
6625387
from torch import nn from tqdm import tqdm def fit(model: nn.Module, train_loader, val_loader, optimizer, criterion, epochs, lr_scheduler=None): print('Starting fitting for', model.__class__.__name__) for epoch in range(epochs): # train epoch # test epochs # log results # step...
from torch import nn from tqdm import tqdm def fit(model: nn.Module, train_loader, val_loader, optimizer, criterion, epochs, lr_scheduler=None): print('Starting fitting for', model.__class__.__name__) for epoch in range(epochs): # train epoch # test epochs # log results # step...
en
0.665912
# train epoch # test epochs # log results # step lr_scheduler
2.443553
2
scripts/generate_ibl_index.py
paranblues/dspbr-pt
0
6625388
<gh_stars>0 #!/usr/bin/env python # @license # Copyright 2020 <NAME> - 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 #...
#!/usr/bin/env python # @license # Copyright 2020 <NAME> - 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 re...
en
0.82511
#!/usr/bin/env python # @license # Copyright 2020 <NAME> - 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 re...
2.293055
2
test/commands/extended/get_latest_inclusion_test.py
Cornode/cornode.lib.py
0
6625389
<filename>test/commands/extended/get_latest_inclusion_test.py # coding=utf-8 from __future__ import absolute_import, division, print_function, \ unicode_literals from unittest import TestCase import filters as f from filters.test import BaseFilterTestCase from six import binary_type, text_type from cornode import ...
<filename>test/commands/extended/get_latest_inclusion_test.py # coding=utf-8 from __future__ import absolute_import, division, print_function, \ unicode_literals from unittest import TestCase import filters as f from filters.test import BaseFilterTestCase from six import binary_type, text_type from cornode import ...
en
0.876585
# coding=utf-8 # noinspection SpellCheckingInspection Request is valid. Request contains values that can be converted to the expected types. # Any TrytesCompatible value can be used here. Request is empty. Request contains unexpected parameters. # Uh, before we dock, I think we ought to discuss the bonus # situatio...
2.245391
2
tests/web_platform/css_grid_1/grid_items/test_grid_inline_order_property_auto_placement.py
jonboland/colosseum
71
6625390
<reponame>jonboland/colosseum from tests.utils import W3CTestCase class TestGridInlineOrderPropertyAutoPlacement(W3CTestCase): vars().update(W3CTestCase.find_tests(__file__, 'grid-inline-order-property-auto-placement-'))
from tests.utils import W3CTestCase class TestGridInlineOrderPropertyAutoPlacement(W3CTestCase): vars().update(W3CTestCase.find_tests(__file__, 'grid-inline-order-property-auto-placement-'))
none
1
1.710456
2
dig/phone/matchphone.py
usc-isi-i2/dig-features
0
6625391
#!/usr/bin/python # -*- coding: utf-8 -*- # Filename: matchphone.py ''' dig.phone.matchphone @author: <NAME> @version 2.5 wat phone matching module needs to get its data from watpara Usage: Options: \t-h, --help:\tprint help to STDOUT and quit \t-v, --verbose:\tverbose output \t-s, --source:\tsource default backpage...
#!/usr/bin/python # -*- coding: utf-8 -*- # Filename: matchphone.py ''' dig.phone.matchphone @author: <NAME> @version 2.5 wat phone matching module needs to get its data from watpara Usage: Options: \t-h, --help:\tprint help to STDOUT and quit \t-v, --verbose:\tverbose output \t-s, --source:\tsource default backpage...
en
0.42563
#!/usr/bin/python # -*- coding: utf-8 -*- # Filename: matchphone.py dig.phone.matchphone @author: <NAME> @version 2.5 wat phone matching module needs to get its data from watpara Usage: Options: \t-h, --help:\tprint help to STDOUT and quit \t-v, --verbose:\tverbose output \t-s, --source:\tsource default backpage ^[2-...
3.043629
3
Programiz/Calculate the Area of a Triangle/Sol.py
Pandz18/C-Programs
0
6625392
<filename>Programiz/Calculate the Area of a Triangle/Sol.py h=int(input("Enter height")) w=int(input("Enter width")) area=(h*w)/2 print("Area of the triangle: " + str(area))
<filename>Programiz/Calculate the Area of a Triangle/Sol.py h=int(input("Enter height")) w=int(input("Enter width")) area=(h*w)/2 print("Area of the triangle: " + str(area))
none
1
4.0988
4
tests/test_notes.py
danilakritsky/pt1-43-21-14
0
6625393
"""This modules contains tests for the api routes.""" import json from pydantic import ValidationError import pytest import unittest.mock as mock from app.api import crud from bson.objectid import ObjectId def test_create_note(test_client, test_note_id, monkeypatch): test_request_body = {"title": "New Note", "...
"""This modules contains tests for the api routes.""" import json from pydantic import ValidationError import pytest import unittest.mock as mock from app.api import crud from bson.objectid import ObjectId def test_create_note(test_client, test_note_id, monkeypatch): test_request_body = {"title": "New Note", "...
en
0.560004
This modules contains tests for the api routes. # jsonifies the body # jsonifies response # TODO # create a mock DeleteResult object
2.650434
3
sources/rnt/mediane/algorithms/ailon/RepeatChoice.py
bryan-brancotte/rank-aggregation-with-ties
0
6625394
from typing import List from random import shuffle from mediane.algorithms.median_ranking import MedianRanking, DistanceNotHandledException from mediane.distances.enumeration import GENERALIZED_KENDALL_TAU_DISTANCE, GENERALIZED_INDUCED_KENDALL_TAU_DISTANCE, \ GENERALIZED_KENDALL_TAU_DISTANCE_WITH_UNIFICATION from m...
from typing import List from random import shuffle from mediane.algorithms.median_ranking import MedianRanking, DistanceNotHandledException from mediane.distances.enumeration import GENERALIZED_KENDALL_TAU_DISTANCE, GENERALIZED_INDUCED_KENDALL_TAU_DISTANCE, \ GENERALIZED_KENDALL_TAU_DISTANCE_WITH_UNIFICATION from m...
en
0.76928
:param rankings: A set of rankings :type rankings: list :param distance: The distance to use/consider :type distance: Distance :param return_at_most_one_ranking: the algorithm should not return more than one ranking :type return_at_most_one_ranking: bool :return one or mo...
3.002695
3
spk/subliminal/src/app/scanner.py
BKSteve/spksrc
2,211
6625395
#!/usr/local/subliminal/env/bin/python from application.db import Session, Directory from application.direct import Subliminal, scan, notify import os import sys import argparse class Scanner(object): def __init__(self, directory_id): self.directory_id = directory_id self.session = Session() ...
#!/usr/local/subliminal/env/bin/python from application.db import Session, Directory from application.direct import Subliminal, scan, notify import os import sys import argparse class Scanner(object): def __init__(self, directory_id): self.directory_id = directory_id self.session = Session() ...
en
0.50331
#!/usr/local/subliminal/env/bin/python Do the UNIX double-fork magic, see Stevens' "Advanced Programming in the UNIX Environment" for details (ISBN 0201563177) http://www.erlenstar.demon.co.uk/unix/faq_2.html#SEC16 # exit first parent #1 failed: %d (%s)\n' % (e.errno, e.strerror)) # decouple from parent...
2.550938
3
src/test_train_model.py
iDataist/Deploying-a-Scalable-ML-Pipeline-in-Production
0
6625396
<reponame>iDataist/Deploying-a-Scalable-ML-Pipeline-in-Production<filename>src/test_train_model.py import os import numpy as np import logging import pytest import constants from ml.data import ( import_data, perform_eda, scaler, encoder, perform_train_test_split, ) from ml.model import train_models...
import os import numpy as np import logging import pytest import constants from ml.data import ( import_data, perform_eda, scaler, encoder, perform_train_test_split, ) from ml.model import train_models, inference, compute_model_metrics logging.basicConfig( level=logging.INFO, filename=const...
de
0.421695
test data import test perform eda function test scaler test encoder test encoder test train_models ###########################################################")
2.394765
2
setup.py
invenia/GitLabChangelog
0
6625397
import codecs from os.path import abspath, dirname, join from setuptools import find_packages, setup TEST_DEPS = ["coverage[toml]", "pytest", "pytest-cov"] DOCS_DEPS = ["sphinx", "sphinx-rtd-theme", "sphinx-autoapi", "recommonmark"] CHECK_DEPS = [ "isort", "flake8", "flake8-quotes", "pep8-naming", ...
import codecs from os.path import abspath, dirname, join from setuptools import find_packages, setup TEST_DEPS = ["coverage[toml]", "pytest", "pytest-cov"] DOCS_DEPS = ["sphinx", "sphinx-rtd-theme", "sphinx-autoapi", "recommonmark"] CHECK_DEPS = [ "isort", "flake8", "flake8-quotes", "pep8-naming", ...
en
0.893044
# Read in the version
1.382054
1
zerver/webhooks/statuspage/view.py
ricardoteixeiraduarte/zulip
3
6625398
<reponame>ricardoteixeiraduarte/zulip # Webhooks for external integrations. from django.utils.translation import ugettext as _ from zerver.lib.response import json_success from zerver.lib.webhooks.common import check_send_webhook_message from zerver.decorator import REQ, has_request_variables, api_key_only_webhook_view...
# Webhooks for external integrations. from django.utils.translation import ugettext as _ from zerver.lib.response import json_success from zerver.lib.webhooks.common import check_send_webhook_message from zerver.decorator import REQ, has_request_variables, api_key_only_webhook_view from zerver.models import get_client,...
en
0.818381
# Webhooks for external integrations.
1.984127
2
devconf/ast/literal.py
everclear72216/ucapi
0
6625399
<filename>devconf/ast/literal.py<gh_stars>0 import ast.mixins.expression class Literal(ast.mixins.expression.RValueExpression): def __init__(self): super().__init__() def set_value(self, value): self.set_type(value.get_type()) super().set_value(value)
<filename>devconf/ast/literal.py<gh_stars>0 import ast.mixins.expression class Literal(ast.mixins.expression.RValueExpression): def __init__(self): super().__init__() def set_value(self, value): self.set_type(value.get_type()) super().set_value(value)
none
1
2.112157
2
supervisor/hassos.py
srdjanrosic/supervisor
1
6625400
<reponame>srdjanrosic/supervisor """HassOS support on supervisor.""" import asyncio import logging from pathlib import Path from typing import Awaitable, Optional import aiohttp from awesomeversion import AwesomeVersion, AwesomeVersionException from cpe import CPE from .coresys import CoreSys, CoreSysAttributes from ...
"""HassOS support on supervisor.""" import asyncio import logging from pathlib import Path from typing import Awaitable, Optional import aiohttp from awesomeversion import AwesomeVersion, AwesomeVersionException from cpe import CPE from .coresys import CoreSys, CoreSysAttributes from .dbus.rauc import RaucState from ...
en
0.660204
HassOS support on supervisor. HassOS interface inside supervisor. Initialize HassOS handler. Return True, if HassOS on host. Return version of HassOS. Return version of HassOS. Return true if a HassOS update is available. Return board name. Return OS name. # OS version 6 and later renamed intel-nuc to generic-x86-64......
2.133447
2
IPython/quarantine/ipy_fsops.py
dchichkov/ipython
1
6625401
""" File system operations Contains: Simple variants of normal unix shell commands (icp, imv, irm, imkdir, igrep). Some "otherwise handy" utils ('collect' for gathering files to ~/_ipython/collect, 'inote' for collecting single note lines to ~/_ipython/note.txt) Mostly of use for bare windows installations where cyg...
""" File system operations Contains: Simple variants of normal unix shell commands (icp, imv, irm, imkdir, igrep). Some "otherwise handy" utils ('collect' for gathering files to ~/_ipython/collect, 'inote' for collecting single note lines to ~/_ipython/note.txt) Mostly of use for bare windows installations where cyg...
en
0.739703
File system operations Contains: Simple variants of normal unix shell commands (icp, imv, irm, imkdir, igrep). Some "otherwise handy" utils ('collect' for gathering files to ~/_ipython/collect, 'inote' for collecting single note lines to ~/_ipython/note.txt) Mostly of use for bare windows installations where cygwin/...
2.88274
3
benchexec/resources.py
blizzard4591/benchexec
0
6625402
<filename>benchexec/resources.py # This file is part of BenchExec, a framework for reliable benchmarking: # https://github.com/sosy-lab/benchexec # # SPDX-FileCopyrightText: 2007-2020 <NAME> <https://www.sosy-lab.org> # # SPDX-License-Identifier: Apache-2.0 """ This module contains functions for computing assignments ...
<filename>benchexec/resources.py # This file is part of BenchExec, a framework for reliable benchmarking: # https://github.com/sosy-lab/benchexec # # SPDX-FileCopyrightText: 2007-2020 <NAME> <https://www.sosy-lab.org> # # SPDX-License-Identifier: Apache-2.0 """ This module contains functions for computing assignments ...
en
0.86213
# This file is part of BenchExec, a framework for reliable benchmarking: # https://github.com/sosy-lab/benchexec # # SPDX-FileCopyrightText: 2007-2020 <NAME> <https://www.sosy-lab.org> # # SPDX-License-Identifier: Apache-2.0 This module contains functions for computing assignments of resources to runs. Calculate an ass...
2.877533
3
setup.py
qamplus/qamplus-pythonsdk
0
6625403
import sys from os import path from setuptools import setup, find_packages EXCLUDE_FROM_PACKAGES = ['tests'] needs_mock = sys.version_info < (3, 3) mock = ['mock'] if needs_mock else [] here = path.abspath(path.dirname(__file__)) version = "2.2.1" setup(name='qamplus', version=version, description="QA...
import sys from os import path from setuptools import setup, find_packages EXCLUDE_FROM_PACKAGES = ['tests'] needs_mock = sys.version_info < (3, 3) mock = ['mock'] if needs_mock else [] here = path.abspath(path.dirname(__file__)) version = "2.2.1" setup(name='qamplus', version=version, description="QA...
none
1
1.705091
2
CollisionDetection.py
Zel9689/Typehero
0
6625404
import numpy as np dimension = 2 # 判斷是否跟方向D同方向(+-90度) def SameDirection(direction, ao): return np.dot(direction, ao) > 0 class Collider: def __init__(self, vertices): self.vertices = vertices # 找到跟方向D內積最大的頂點 def FindFurthestPoint(self, direction): maxDistance = np.finfo(float).min ...
import numpy as np dimension = 2 # 判斷是否跟方向D同方向(+-90度) def SameDirection(direction, ao): return np.dot(direction, ao) > 0 class Collider: def __init__(self, vertices): self.vertices = vertices # 找到跟方向D內積最大的頂點 def FindFurthestPoint(self, direction): maxDistance = np.finfo(float).min ...
zh
0.980351
# 判斷是否跟方向D同方向(+-90度) # 找到跟方向D內積最大的頂點 # 兩個形狀找出的頂點所形成的向量(這些向量末點可以構成圖形,如果圖形包含原點在內則代表碰撞)
3.062836
3
scripts/reactor/undefined.py
G00dBye/YYMS
54
6625405
<filename>scripts/reactor/undefined.py<gh_stars>10-100 sm.chat("Unhandled reactor script, Please update us in MapleEllinel forums. ID: " + str(parentID)) sm.dispose()
<filename>scripts/reactor/undefined.py<gh_stars>10-100 sm.chat("Unhandled reactor script, Please update us in MapleEllinel forums. ID: " + str(parentID)) sm.dispose()
none
1
1.250584
1
automlib.py
nitishkthakur/automl
2
6625406
<filename>automlib.py<gh_stars>1-10 import pandas as pd import numpy as np from sklearn import preprocessing, model_selection, metrics, ensemble from imblearn import over_sampling, under_sampling, combine import pyswarm import lightgbm as lgb class psoregressor: def __init__(self, population = 30, omega=...
<filename>automlib.py<gh_stars>1-10 import pandas as pd import numpy as np from sklearn import preprocessing, model_selection, metrics, ensemble from imblearn import over_sampling, under_sampling, combine import pyswarm import lightgbm as lgb class psoregressor: def __init__(self, population = 30, omega=...
en
0.404044
#X_train_inner, X_test_inner, y_train_inner, y_test_inner = model_selection.train_test_split(X, y, test_size = 0.2, random_state = 40, shuffle = True) # Define Objective function # Perform Model Optimization # Fit the best model ###########################################################################################...
2.543703
3
NippoKun/report/models.py
KIKUYA-Takumi/Nippokun
0
6625407
from django.contrib.auth.models import User from django.db import models # Create your models here. class Report(models.Model): report_author = models.ForeignKey(User, related_name='report_author') report_title = models.CharField(max_length=50) report_content = models.TextField(max_length=999) create...
from django.contrib.auth.models import User from django.db import models # Create your models here. class Report(models.Model): report_author = models.ForeignKey(User, related_name='report_author') report_title = models.CharField(max_length=50) report_content = models.TextField(max_length=999) create...
en
0.963489
# Create your models here.
2.265966
2
src/pbn_api/migrations/0014_auto_20210713_2229.py
iplweb/django-bpp
1
6625408
<filename>src/pbn_api/migrations/0014_auto_20210713_2229.py # Generated by Django 3.0.14 on 2021-07-13 20:29 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("pbn_api", "0013_oswiadczenieinstytucji_publikacjainstytucji"), ] operations = [ ...
<filename>src/pbn_api/migrations/0014_auto_20210713_2229.py # Generated by Django 3.0.14 on 2021-07-13 20:29 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("pbn_api", "0013_oswiadczenieinstytucji_publikacjainstytucji"), ] operations = [ ...
en
0.823596
# Generated by Django 3.0.14 on 2021-07-13 20:29
1.386224
1
comet/convergence.py
raphael-group/comet
20
6625409
import math import numpy as np from scipy.stats import * def tv(p, q): """ Total variance distance """ return max([abs(p[i] - q[i]) for i in range(len(p))]) def discrete_convergence_eqb_plot(filelist, num_genes, ks_set, outprefix): klets_seq, gset2weight = dict(), dict() for f in filelist: ...
import math import numpy as np from scipy.stats import * def tv(p, q): """ Total variance distance """ return max([abs(p[i] - q[i]) for i in range(len(p))]) def discrete_convergence_eqb_plot(filelist, num_genes, ks_set, outprefix): klets_seq, gset2weight = dict(), dict() for f in filelist: ...
en
0.240772
Total variance distance #for i in range(last_eqb, s_length): #range_start = i - last_eqb + 1 #sum_f[f] -= klets_seq[f][i - last_eqb]['W'] #sum_f[f] += klets_seq[f][i]['W'] #sum_f[f] += klets_seq[f][j]['W'] #sum_w[f][klets_seq[f][j]['G']] = 0 #sum_w[f][klets_seq[f][j]['G']] += klets_seq[f][j]['W'] #union_w[klets_seq[f][...
2.681783
3
api/urls.py
iafisher/writingstreak
2
6625410
<reponame>iafisher/writingstreak<filename>api/urls.py from django.urls import path from . import views app_name = 'api' urlpatterns = [ path('fetch', views.fetch, name='fetch'), path('update', views.update, name='update'), ]
from django.urls import path from . import views app_name = 'api' urlpatterns = [ path('fetch', views.fetch, name='fetch'), path('update', views.update, name='update'), ]
none
1
1.759781
2
pytest-tests/infra/pages.py
itaiag/login-example
1
6625411
''' Created on Jul 9, 2015 @author: Itai ''' from infra.actionbot import Locator from infra.base_page import BasePageObject import tests.marks as m class LoginPage(BasePageObject): ''' classdocs ''' _USERNAME_TB_BY = Locator.id("username") _PASSWORD_TB_BY = Locator.id("password") _REGIS...
''' Created on Jul 9, 2015 @author: Itai ''' from infra.actionbot import Locator from infra.base_page import BasePageObject import tests.marks as m class LoginPage(BasePageObject): ''' classdocs ''' _USERNAME_TB_BY = Locator.id("username") _PASSWORD_TB_BY = Locator.id("password") _REGIS...
en
0.921126
Created on Jul 9, 2015 @author: Itai classdocs Construbdctor The purpose of this method is to be an example for a failed action # We want to make sure that we are still in the login page.
2.305597
2
atomize/device_modules/SR_865a.py
Anatoly1010/Atomize_ITC
1
6625412
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import gc import sys import pyvisa from pyvisa.constants import StopBits, Parity import atomize.device_modules.config.config_utils as cutil import atomize.general_modules.general_functions as general class SR_865a: #### Basic interaction functions def _...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import gc import sys import pyvisa from pyvisa.constants import StopBits, Parity import atomize.device_modules.config.config_utils as cutil import atomize.general_modules.general_functions as general class SR_865a: #### Basic interaction functions def _...
en
0.675379
#!/usr/bin/env python3 # -*- coding: utf-8 -*- #### Basic interaction functions #### Inizialization # setting path to *.ini file # configuration data # auxilary dictionaries # Ranges and limits # Test run parameters # These values are returned by the modules in the test run # test should be here # in ms # test should b...
1.942308
2
pages/login.py
armaaar/items-catalog
0
6625413
<reponame>armaaar/items-catalog<filename>pages/login.py from _imports import * from db import * from flask import send_from_directory from oauth2client.client import flow_from_clientsecrets from oauth2client.client import FlowExchangeError import httplib2 import requests import json import os CLIENT_ID = json.loads( ...
from _imports import * from db import * from flask import send_from_directory from oauth2client.client import flow_from_clientsecrets from oauth2client.client import FlowExchangeError import httplib2 import requests import json import os CLIENT_ID = json.loads( open('client_secret.json', 'r').read())['web']['clie...
en
0.811632
# STEP 1 - Parse the auth code # STEP 2 - Exchange for a token # Upgrade the authorization code into a credentials object # Check that the access token is valid. # If there was an error in the access token info, abort. # Verify that the access token is used for the intended user. # Verify that the access token is valid...
2.750098
3
check.py
toni-heittola/dcase_glossary
1
6625414
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import os import glob import yaml import argparse def main(argv): parser = argparse.ArgumentParser(description='Script to investigate glossary file.') parser.add_argument("-D", "--definitions", help="show terms with empty definitions", action="store_true...
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import os import glob import yaml import argparse def main(argv): parser = argparse.ArgumentParser(description='Script to investigate glossary file.') parser.add_argument("-D", "--definitions", help="show terms with empty definitions", action="store_true...
en
0.312125
#!/usr/bin/env python # -*- coding: utf-8 -*- # Read template
3.345346
3
oneflow/python/test/ops/test_tril.py
Ldpe2G/oneflow
2
6625415
""" Copyright 2020 The OneFlow Authors. 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 or agr...
""" Copyright 2020 The OneFlow Authors. 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 or agr...
en
0.864155
Copyright 2020 The OneFlow Authors. 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 or agreed ...
1.889432
2
source/NVDAObjects/IAccessible/mozilla.py
raza-al-pakistani/raza-al-pakistani--v20022.3.1
0
6625416
# -*- coding: UTF-8 -*- # A part of NonVisual Desktop Access (NVDA) # This file is covered by the GNU General Public License. # See the file COPYING for more details. # Copyright (C) 2006-2021 NV Access Limited, <NAME> import IAccessibleHandler from comInterfaces import IAccessible2Lib as IA2 import oleacc import winU...
# -*- coding: UTF-8 -*- # A part of NonVisual Desktop Access (NVDA) # This file is covered by the GNU General Public License. # See the file COPYING for more details. # Copyright (C) 2006-2021 NV Access Limited, <NAME> import IAccessibleHandler from comInterfaces import IAccessible2Lib as IA2 import oleacc import winU...
en
0.853187
# -*- coding: UTF-8 -*- # A part of NonVisual Desktop Access (NVDA) # This file is covered by the GNU General Public License. # See the file COPYING for more details. # Copyright (C) 2006-2021 NV Access Limited, <NAME> Firefox does not yet support 'description-from' attribute (which informs NVDA of the source of accD...
1.90142
2
lib/galaxy/util/monitors.py
innovate-invent/galaxy
1
6625417
from __future__ import absolute_import import logging import threading from galaxy.web.stack import register_postfork_function from .sleeper import Sleeper log = logging.getLogger(__name__) DEFAULT_MONITOR_THREAD_JOIN_TIMEOUT = 5 class Monitors(object): def _init_monitor_thread(self, name, target_name=None, ...
from __future__ import absolute_import import logging import threading from galaxy.web.stack import register_postfork_function from .sleeper import Sleeper log = logging.getLogger(__name__) DEFAULT_MONITOR_THREAD_JOIN_TIMEOUT = 5 class Monitors(object): def _init_monitor_thread(self, name, target_name=None, ...
none
1
2.351417
2
Login!/Profile/css/flask-image-upload-thing-master/tests/test_delete.py
baguilar1998/artstartWebsite
20
6625418
from StringIO import StringIO from flexmock import flexmock from flask_uploads import delete, save from . import TestCase from .test_save import FakeImage class TestDelete(TestCase): def setup_method(self, method): if method == self.test_deletes_resized_images_from_storage: resizer = flexmock(...
from StringIO import StringIO from flexmock import flexmock from flask_uploads import delete, save from . import TestCase from .test_save import FakeImage class TestDelete(TestCase): def setup_method(self, method): if method == self.test_deletes_resized_images_from_storage: resizer = flexmock(...
none
1
2.368393
2
src/main/resources/pytz/zoneinfo/America/Cordoba.py
TheEin/swagger-maven-plugin
65
6625419
'''tzinfo timezone information for America/Cordoba.''' from pytz.tzinfo import DstTzInfo from pytz.tzinfo import memorized_datetime as d from pytz.tzinfo import memorized_ttinfo as i class Cordoba(DstTzInfo): '''America/Cordoba timezone definition. See datetime.tzinfo for details''' zone = 'America/Cordoba' ...
'''tzinfo timezone information for America/Cordoba.''' from pytz.tzinfo import DstTzInfo from pytz.tzinfo import memorized_datetime as d from pytz.tzinfo import memorized_ttinfo as i class Cordoba(DstTzInfo): '''America/Cordoba timezone definition. See datetime.tzinfo for details''' zone = 'America/Cordoba' ...
en
0.32441
tzinfo timezone information for America/Cordoba. America/Cordoba timezone definition. See datetime.tzinfo for details
2.935139
3
ibllib/atlas/__init__.py
int-brain-lab/ibllib
38
6625420
<reponame>int-brain-lab/ibllib from .atlas import * # noqa from .regions import regions_from_allen_csv
from .atlas import * # noqa from .regions import regions_from_allen_csv
none
1
0.998381
1
githubcommit/handlers.py
surrbsk10/githubcommit
0
6625421
from notebook.utils import url_path_join as ujoin from notebook.base.handlers import IPythonHandler import os, json, git, urllib, requests from git import Repo, GitCommandError from subprocess import check_output import subprocess class GitCommitHandler(IPythonHandler): def error_and_return(self, dirname, reason)...
from notebook.utils import url_path_join as ujoin from notebook.base.handlers import IPythonHandler import os, json, git, urllib, requests from git import Repo, GitCommandError from subprocess import check_output import subprocess class GitCommitHandler(IPythonHandler): def error_and_return(self, dirname, reason)...
en
0.771479
# send error # return to directory # git parameters from environment variables # expand variables since Docker's will pass VAR=$VAL as $VAL without expansion # get the parent directory for git operations # obtain filename and msg for commit # get current directory (to return later) # select branch within repo # create ...
2.156232
2
src/grokcore/component/tests/adapter/implementsnonemulti.py
bielbienne/grokcore.component
0
6625422
<reponame>bielbienne/grokcore.component """ Subclasses of grok.Adapter and grok.MultiAdapter must implement exactly one interface: >>> grok.testing.grok(__name__) Traceback (most recent call last): ... GrokError: <class 'grokcore.component.tests.adapter.implementsnonemulti.Home'> must implement at least on...
""" Subclasses of grok.Adapter and grok.MultiAdapter must implement exactly one interface: >>> grok.testing.grok(__name__) Traceback (most recent call last): ... GrokError: <class 'grokcore.component.tests.adapter.implementsnonemulti.Home'> must implement at least one interface (use grok.implements to spec...
en
0.417995
Subclasses of grok.Adapter and grok.MultiAdapter must implement exactly one interface: >>> grok.testing.grok(__name__) Traceback (most recent call last): ... GrokError: <class 'grokcore.component.tests.adapter.implementsnonemulti.Home'> must implement at least one interface (use grok.implements to specify)...
2.122558
2
infovoid/infovoid/apps/services/urls.py
wes-o/infovoid
0
6625423
from django.urls import path from . import views app_name = 'services' urlpatterns = [ path('', views.index, name='index'), path('archive/', views.archive, name='archive'), path('<int:year>/', views.year, name='year'), path('<int:year>/<int:month>/', views.month, name='month'), path('<int:year>...
from django.urls import path from . import views app_name = 'services' urlpatterns = [ path('', views.index, name='index'), path('archive/', views.archive, name='archive'), path('<int:year>/', views.year, name='year'), path('<int:year>/<int:month>/', views.month, name='month'), path('<int:year>...
none
1
1.745524
2
app/migrations/0005_auto_20210701_0342.py
Divyanshukalola/Alchemeo
0
6625424
<gh_stars>0 # Generated by Django 2.2.10 on 2021-07-01 03:42 import datetime from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('app', '0004_auto_20210630_0658'), ] operations = [ migrations.AddField( model_name='invoice', ...
# Generated by Django 2.2.10 on 2021-07-01 03:42 import datetime from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('app', '0004_auto_20210630_0658'), ] operations = [ migrations.AddField( model_name='invoice', name=...
en
0.782329
# Generated by Django 2.2.10 on 2021-07-01 03:42
1.723261
2
CONTENT/Resources/guides/__UNSORTED/296_best_meeting_point/meetingpoint.py
impastasyndrome/DS-ALGO-OFFICIAL
13
6625425
class Solution(object): def minTotalDistance(self, grid): """ :type grid: List[List[int]] :rtype: int """ if not grid: return 0 rows = [] cols = [] for i in range(len(grid)): for j in range(len(grid[0])): if grid...
class Solution(object): def minTotalDistance(self, grid): """ :type grid: List[List[int]] :rtype: int """ if not grid: return 0 rows = [] cols = [] for i in range(len(grid)): for j in range(len(grid[0])): if grid...
en
0.28359
:type grid: List[List[int]] :rtype: int
3.271884
3
venv/Lib/site-packages/pandas/io/html.py
ajayiagbebaku/NFL-Model
6,989
6625426
""" :mod:`pandas.io.html` is a module containing functionality for dealing with HTML IO. """ from __future__ import annotations from collections import abc import numbers import os import re from typing import ( Pattern, Sequence, ) from pandas._typing import FilePathOrBuffer from pandas.compat._optional im...
""" :mod:`pandas.io.html` is a module containing functionality for dealing with HTML IO. """ from __future__ import annotations from collections import abc import numbers import os import re from typing import ( Pattern, Sequence, ) from pandas._typing import FilePathOrBuffer from pandas.compat._optional im...
en
0.649662
:mod:`pandas.io.html` is a module containing functionality for dealing with HTML IO. # import things we need # but make this done on a first use basis ############# # READ HTML # ############# Replace extra whitespace inside of a string with a single space. Parameters ---------- s : str or unicode ...
2.705254
3
sceptre/cli/__init__.py
shixuyue/sceptre
0
6625427
<reponame>shixuyue/sceptre # -*- coding: utf-8 -*- """ sceptre.cli This module implements Sceptre's CLI, and should not be directly imported. """ import os import warnings import click import colorama from sceptre import __version__ from sceptre.cli.new import new_group from sceptre.cli.create import create_comma...
# -*- coding: utf-8 -*- """ sceptre.cli This module implements Sceptre's CLI, and should not be directly imported. """ import os import warnings import click import colorama from sceptre import __version__ from sceptre.cli.new import new_group from sceptre.cli.create import create_command from sceptre.cli.update ...
en
0.749326
# -*- coding: utf-8 -*- sceptre.cli This module implements Sceptre's CLI, and should not be directly imported. Sceptre is a tool to manage your cloud native infrastructure deployments. # Enable deprecation warnings
1.893979
2
cli/tests/int/test_ssm_cli.py
eyalstoler/ssm-simple-cli
0
6625428
import os import boto3 import pytest from click.testing import CliRunner from moto import mock_ssm from cli.src import ssm_cli from cli.src.ssm_cli import CliConfiguration, DEFAULT_SSM_CONFIG_PARAMS @pytest.fixture(scope='function') def aws_credentials(tmpdir): fake_aws_creds = tmpdir.join("fake_aws_credentials...
import os import boto3 import pytest from click.testing import CliRunner from moto import mock_ssm from cli.src import ssm_cli from cli.src.ssm_cli import CliConfiguration, DEFAULT_SSM_CONFIG_PARAMS @pytest.fixture(scope='function') def aws_credentials(tmpdir): fake_aws_creds = tmpdir.join("fake_aws_credentials...
en
0.19826
Mocked AWS Credentials for moto. # noinspection PyUnusedLocal # noinspection PyUnusedLocal # noinspection PyUnusedLocal # noinspection PyUnusedLocal
1.766581
2
utils/csrt_session.py
atlassian-labs/connect-security-req-tester
14
6625429
import requests from requests.adapters import HTTPAdapter session = None # Ref: https://stackoverflow.com/a/62044100 # Create an HTTP Adapter that we can mount to a Requests.Session object to globally apply # a timeout on all requests class TimeoutHTTPAdapter(HTTPAdapter): def __init__(self, *args, **kwargs): ...
import requests from requests.adapters import HTTPAdapter session = None # Ref: https://stackoverflow.com/a/62044100 # Create an HTTP Adapter that we can mount to a Requests.Session object to globally apply # a timeout on all requests class TimeoutHTTPAdapter(HTTPAdapter): def __init__(self, *args, **kwargs): ...
en
0.75964
# Ref: https://stackoverflow.com/a/62044100 # Create an HTTP Adapter that we can mount to a Requests.Session object to globally apply # a timeout on all requests Return a requests.Session object setup in a standard way to make HTTP requests from Returns: requests.Session: A session object pre-configured fo...
2.998206
3
src/robot.py
jevancc/ece276a-visual-inertial-slam
21
6625430
import numpy as np def wedge(x): assert x.size in [3, 6] x = x.reshape(-1) if x.size == 3: return np.array([[0, -x[2], x[1]], [x[2], 0, -x[0]], [-x[1], x[0], 0]]) elif x.size == 6: return np.block([[wedge(x[3:]), x[:3].reshape(-1, 1)], [np.array([0, 0, 0, 0])]]) def cwedge(x): as...
import numpy as np def wedge(x): assert x.size in [3, 6] x = x.reshape(-1) if x.size == 3: return np.array([[0, -x[2], x[1]], [x[2], 0, -x[0]], [-x[1], x[0], 0]]) elif x.size == 6: return np.block([[wedge(x[3:]), x[:3].reshape(-1, 1)], [np.array([0, 0, 0, 0])]]) def cwedge(x): as...
none
1
2.715062
3
neointerface/neointerface.py
GSK-Biostatistics/neointerface
9
6625431
from neo4j import GraphDatabase # The Neo4j python connectivity library "Neo4j Python Driver" from neo4j import __version__ as neo4j_driver_version # The version of the Neo4j driver being used import neo4j.graph # To check returned data types import numpy as np import pandas as pd import inspect import os import req...
from neo4j import GraphDatabase # The Neo4j python connectivity library "Neo4j Python Driver" from neo4j import __version__ as neo4j_driver_version # The version of the Neo4j driver being used import neo4j.graph # To check returned data types import numpy as np import pandas as pd import inspect import os import req...
en
0.690222
# The Neo4j python connectivity library "Neo4j Python Driver" # The version of the Neo4j driver being used # To check returned data types High level class to interact with neo4j from Python. It provides a higher-level wrapper around the Neo4j python connectivity library "Neo4j Python Driver", documented at: htt...
2.818413
3
zun/db/sqlalchemy/alembic/versions/cf46a28f46bc_add_container_actions_table.py
wanghuiict/zun
83
6625432
# 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, software # distributed under the Li...
# 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, software # distributed under the Li...
en
0.800344
# 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, software # distributed under the Li...
1.854996
2
simpledecorators/Safe.py
shaddyx/simpleDecorators
1
6625433
from functools import wraps def Safe(exception=Exception): """safe function call (if function raises an exception) it will be ignored""" def decorator(fn): @wraps(fn) def wrapped(*args, **kwargs): try: return fn(*args, **kwargs) except exception: ...
from functools import wraps def Safe(exception=Exception): """safe function call (if function raises an exception) it will be ignored""" def decorator(fn): @wraps(fn) def wrapped(*args, **kwargs): try: return fn(*args, **kwargs) except exception: ...
en
0.519177
safe function call (if function raises an exception) it will be ignored
3.671502
4
utilities/data_preprocessor/scripts/get_PCD.py
alanjclark/autoware.ai
2
6625434
#!/usr/bin/env python3 import sys import os import rospy import numpy as np import cv2 import pcl import sensor_msgs.point_cloud2 as pc2 from sensor_msgs.msg import PointCloud2 from cv_bridge import CvBridge save_path = None def cloud_loader(msg): timestamp = msg.header.stamp.secs + ((msg.header.stamp.nsecs + 0.0...
#!/usr/bin/env python3 import sys import os import rospy import numpy as np import cv2 import pcl import sensor_msgs.point_cloud2 as pc2 from sensor_msgs.msg import PointCloud2 from cv_bridge import CvBridge save_path = None def cloud_loader(msg): timestamp = msg.header.stamp.secs + ((msg.header.stamp.nsecs + 0.0...
fa
0.060346
#!/usr/bin/env python3 #sys.exit("Please specify the save path. Example: rosbag_data_extract_unsync.py /media/0/output/")
2.313628
2
examples/add_bond.py
oliel/python-ovirt-engine-sdk4
3
6625435
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2017 Red Hat, 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...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2017 Red Hat, 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...
en
0.866647
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2017 Red Hat, 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 ...
2.164955
2
src/model/game.py
cpatrasciuc/schnapsen-card-game
0
6625436
# Copyright (c) 2021 <NAME>. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from typing import List, Any from model.game_state import GameState from model.player_action import PlayerAction from model.player_id import PlayerId class Game:...
# Copyright (c) 2021 <NAME>. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from typing import List, Any from model.game_state import GameState from model.player_action import PlayerAction from model.player_id import PlayerId class Game:...
en
0.958702
# Copyright (c) 2021 <NAME>. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. A class that stores a game of Schnapsen: it stores the initial state (i.e., the dealer ID and the random seed used to shuffle the deck) and a list of player acti...
3.313564
3
helpers.py
Raymw1/birthdaysv2
3
6625437
from functools import wraps from flask import redirect, render_template, session def apology(page, message, code=400, data=None): return render_template(page, error=message, data=data), code def apologyBirth(page, message, birthdays, code=400, data=None): return render_template(page, error=message, data=data, bir...
from functools import wraps from flask import redirect, render_template, session def apology(page, message, code=400, data=None): return render_template(page, error=message, data=data), code def apologyBirth(page, message, birthdays, code=400, data=None): return render_template(page, error=message, data=data, bir...
en
0.542754
Decorate routes to require login. https://flask.palletsprojects.com/en/1.1.x/patterns/viewdecorators/
2.73749
3
nydus/db/backends/riak.py
ageron/nydus
2
6625438
<reponame>ageron/nydus<gh_stars>1-10 """ nydus.db.backends.riak ~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2011 DISQUS. :license: Apache License 2.0, see LICENSE for more details. """ from __future__ import absolute_import import socket import httplib from riak import RiakClient, RiakError from nydus.db.backends impor...
""" nydus.db.backends.riak ~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2011 DISQUS. :license: Apache License 2.0, see LICENSE for more details. """ from __future__ import absolute_import import socket import httplib from riak import RiakClient, RiakError from nydus.db.backends import BaseConnection class Riak(BaseCon...
en
0.588107
nydus.db.backends.riak ~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2011 DISQUS. :license: Apache License 2.0, see LICENSE for more details. # Exceptions that can be retried by this backend
2.077894
2
div_p2p/test_thread.py
mliroz/diversity_p2p
0
6625439
import os from threading import Thread from execo.action import TaktukPut from execo.log import style from execo_engine import logger from div_p2p.wrapper import DivP2PWrapper class TestThread(Thread): """This class manages the consumption and execution of combinations.""" def __init__(self, host, comb_manag...
import os from threading import Thread from execo.action import TaktukPut from execo.log import style from execo_engine import logger from div_p2p.wrapper import DivP2PWrapper class TestThread(Thread): """This class manages the consumption and execution of combinations.""" def __init__(self, host, comb_manag...
en
0.735843
This class manages the consumption and execution of combinations. # Getting the next combination (which uses a new dataset) # subloop over the combinations that use the same dataset Determine if the candidate combination uses the same dataset as the current one. Args: candidate_comb (dict): T...
2.571314
3
py-polars/polars/lazy/frame.py
elsuizo/polars
0
6625440
""" This module contains all expressions and classes needed for lazy computation/ query execution. """ import os import shutil import subprocess import tempfile import typing as tp from typing import Any, Callable, Dict, Optional, Sequence, Tuple, Type, Union import polars as pl try: from polars.polars import PyE...
""" This module contains all expressions and classes needed for lazy computation/ query execution. """ import os import shutil import subprocess import tempfile import typing as tp from typing import Any, Callable, Dict, Optional, Sequence, Tuple, Type, Union import polars as pl try: from polars.polars import PyE...
en
0.533849
This module contains all expressions and classes needed for lazy computation/ query execution. Representation of a Lazy computation graph/ query. See Also: `pl.scan_csv` See Also: `pl.scan_parquet` Apply a function on Self. Parameters ---------- func Callable. args ...
2.530981
3
predict.py
sdc17/NaivePinYin
0
6625441
<reponame>sdc17/NaivePinYin import os import ast import math import pickle import argparse from itertools import product import numpy as np def predict_two_char(ipath, opath, alpha=1e-10, st=25): # load gram gram1 = {} gram2 = {} pinyin = {} with open('./data/1gram.pkl', 'rb') as f: gram1 ...
import os import ast import math import pickle import argparse from itertools import product import numpy as np def predict_two_char(ipath, opath, alpha=1e-10, st=25): # load gram gram1 = {} gram2 = {} pinyin = {} with open('./data/1gram.pkl', 'rb') as f: gram1 = pickle.load(f) with op...
en
0.336969
# load gram # predict # fisrt char # first_prob = {x: math.log(y/tot + 1e-30) for x, y in first_cnt.items()} # probs.append(first_prob) # subsequent chars # dp.append(probs[i - 1][k] + math.log((1 - alpha) * gram2.get(k + j, 0) / (gram1[k] + 1e-30) + alpha * prob_one[j] + 1e-30)) # last char # backtrace # load gram # p...
2.643984
3
scraper.py
elolb/Dota2-Pick-Helper
0
6625442
#! python3 # scraper.py # Scrapes the counter lists from gamepedia. Collects the necessary data for the pick helper. # Data heroList=["Abaddon","Alchemist","Ancient Apparition","Anti-Mage","Arc Warden","Axe","Bane","Batrider","Beastmaster","Bloodseeker","Bounty Hunter",\ "Brewmaster","Bristleback","Bro...
#! python3 # scraper.py # Scrapes the counter lists from gamepedia. Collects the necessary data for the pick helper. # Data heroList=["Abaddon","Alchemist","Ancient Apparition","Anti-Mage","Arc Warden","Axe","Bane","Batrider","Beastmaster","Bloodseeker","Bounty Hunter",\ "Brewmaster","Bristleback","Bro...
en
0.418932
#! python3 # scraper.py # Scrapes the counter lists from gamepedia. Collects the necessary data for the pick helper. # Data # Scraping #print(soup.find('span',id="Bad_against...")) #select bold (only hero names are in bold on the website) #for each hero create 6 lists # for x in some_list: sets x to each element of som...
2.061381
2
cubes_lite/sql/conditions.py
notexistence/cubes_lite
0
6625443
<reponame>notexistence/cubes_lite # -*- coding: utf-8 -*- from __future__ import absolute_import import collections import sqlalchemy.sql as sql from cubes_lite.model.utils import cached_property from cubes_lite.query.conditions import ConditionBase as ConditionBase_ from cubes_lite.sql.mapping import Mapper __all...
# -*- coding: utf-8 -*- from __future__ import absolute_import import collections import sqlalchemy.sql as sql from cubes_lite.model.utils import cached_property from cubes_lite.query.conditions import ConditionBase as ConditionBase_ from cubes_lite.sql.mapping import Mapper __all__ = ( 'PointCondition', '...
en
0.897339
# -*- coding: utf-8 -*- Object describing way of slicing a cube through point in a dimension # in some cases the value is an empty tuple. # using empty or_() expression as a workaround Object describing way of slicing a cube between two points of a dimension that has ordered points. For dimensions with unordere...
2.036719
2
models/tinydb/rediscommand.py
pythononwheels/redmonty
3
6625444
# # TinyDB Model: Rediscommand # from redmonty.models.tinydb.tinymodel import TinyModel class Rediscommand(TinyModel): # # Use the cerberus schema style # which offer you immediate validation with cerberus # http://docs.python-cerberus.org/en/stable/validation-rules.html # types: http://docs.pyt...
# # TinyDB Model: Rediscommand # from redmonty.models.tinydb.tinymodel import TinyModel class Rediscommand(TinyModel): # # Use the cerberus schema style # which offer you immediate validation with cerberus # http://docs.python-cerberus.org/en/stable/validation-rules.html # types: http://docs.pyt...
en
0.772644
# # TinyDB Model: Rediscommand # # # Use the cerberus schema style # which offer you immediate validation with cerberus # http://docs.python-cerberus.org/en/stable/validation-rules.html # types: http://docs.python-cerberus.org/en/stable/validation-rules.html#type # # define class attributes/variables here that should ...
2.369339
2
run_server.py
tartley/restful-categories-exercise
0
6625445
<reponame>tartley/restful-categories-exercise from restful.server import main main()
from restful.server import main main()
none
1
1.137229
1
wagtail/snippets/widgets.py
Immensa/wagtail
2
6625446
import json from django import forms from django.template.loader import render_to_string from django.utils.translation import gettext_lazy as _ from wagtail.admin.staticfiles import versioned_static from wagtail.admin.widgets import AdminChooser class AdminSnippetChooser(AdminChooser): def __init__(self, model...
import json from django import forms from django.template.loader import render_to_string from django.utils.translation import gettext_lazy as _ from wagtail.admin.staticfiles import versioned_static from wagtail.admin.widgets import AdminChooser class AdminSnippetChooser(AdminChooser): def __init__(self, model...
none
1
2.111125
2
portal/migrations/versions/2e1421ac841a_.py
uwcirg/true_nth_usa_portal
3
6625447
"""flush qb_timeline cache for all suspended workers Revision ID: 2e1421ac841a Revises: <PASSWORD> Create Date: 2019-04-16 17:08:12.928760 """ import sqlalchemy as sa from portal.database import db from portal.models.qb_timeline import QBT from portal.models.role import ROLE, Role from portal.models.user import User...
"""flush qb_timeline cache for all suspended workers Revision ID: 2e1421ac841a Revises: <PASSWORD> Create Date: 2019-04-16 17:08:12.928760 """ import sqlalchemy as sa from portal.database import db from portal.models.qb_timeline import QBT from portal.models.role import ROLE, Role from portal.models.user import User...
en
0.556571
flush qb_timeline cache for all suspended workers Revision ID: 2e1421ac841a Revises: <PASSWORD> Create Date: 2019-04-16 17:08:12.928760 # revision identifiers, used by Alembic.
1.859296
2
src/demos/demo_2.py
jduncan1980/CSPT15_DS_ALGO_LinkedLists_GP
0
6625448
""" Given a reference to the head node of a singly-linked list, write a function that reverses the linked list in place. The function should return the new head of the reversed list. In order to do this in O(1) space (in-place), you cannot make a new list, you need to use the existing nodes. In order to do this in O(n)...
""" Given a reference to the head node of a singly-linked list, write a function that reverses the linked list in place. The function should return the new head of the reversed list. In order to do this in O(1) space (in-place), you cannot make a new list, you need to use the existing nodes. In order to do this in O(n)...
en
0.879814
Given a reference to the head node of a singly-linked list, write a function that reverses the linked list in place. The function should return the new head of the reversed list. In order to do this in O(1) space (in-place), you cannot make a new list, you need to use the existing nodes. In order to do this in O(n) tim...
4.220814
4
readData.py
nmchgx/netflix-recommendation
0
6625449
<filename>readData.py #! python2 # coding: utf-8 import numpy as np import pandas as pd from tqdm import tqdm def saveUserKey(): data = np.loadtxt('data/users.txt', dtype='int') np.save('output/user_key.npy', np.array([data, range(0, len(data))]).T) def loadUserKey(): return dict(np.load('data/user_key....
<filename>readData.py #! python2 # coding: utf-8 import numpy as np import pandas as pd from tqdm import tqdm def saveUserKey(): data = np.loadtxt('data/users.txt', dtype='int') np.save('output/user_key.npy', np.array([data, range(0, len(data))]).T) def loadUserKey(): return dict(np.load('data/user_key....
en
0.469341
#! python2 # coding: utf-8
2.820783
3
tests/test_preprocessing.py
thgbaum/plpred
0
6625450
<gh_stars>0 from plpred.preprocessing import compute_aa_composition, generate_aa_composition_df def test_compute_aa_composition_result_simple_homopolymer(): protein_sequence = 'AAAAAA' aa_composition = compute_aa_composition(protein_sequence) assert aa_composition['A'] == 1 def test_compute_aa_composition...
from plpred.preprocessing import compute_aa_composition, generate_aa_composition_df def test_compute_aa_composition_result_simple_homopolymer(): protein_sequence = 'AAAAAA' aa_composition = compute_aa_composition(protein_sequence) assert aa_composition['A'] == 1 def test_compute_aa_composition_result_comp...
none
1
2.324775
2