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 |
|---|---|---|---|---|---|---|---|---|---|---|
application/core/generators/cut_and_match.py | opencbsoft/kids-worksheet-generator | 0 | 6623351 | import string
import random
from core.utils import Generator
class Main(Generator):
name = 'Decupeaza si potriveste'
years = [3, 4, 5]
directions = 'Decupeaza si lipseste literele si cifrele in zonele dedicate lor.'
template = 'generators/cut_and_match.html'
content_height = 1050
def generate... | import string
import random
from core.utils import Generator
class Main(Generator):
name = 'Decupeaza si potriveste'
years = [3, 4, 5]
directions = 'Decupeaza si lipseste literele si cifrele in zonele dedicate lor.'
template = 'generators/cut_and_match.html'
content_height = 1050
def generate... | en | 0.641488 | # Select a minimum of 5 numbers and 5 letters before # Also add 5 minimum letters | 3.483956 | 3 |
Dataset/Leetcode/train/112/214.py | kkcookies99/UAST | 0 | 6623352 | class Solution:
def XXX(self, root: Optional[TreeNode], targetSum: int) -> bool:
if not root:
return False
res = False
def dfs(node, pre):
nonlocal res
if not node:
return
node.val += pre
pre = node.val
... | class Solution:
def XXX(self, root: Optional[TreeNode], targetSum: int) -> bool:
if not root:
return False
res = False
def dfs(node, pre):
nonlocal res
if not node:
return
node.val += pre
pre = node.val
... | none | 1 | 3.186179 | 3 | |
kot/debug/__init__.py | dragon-hex/kot-two-project | 0 | 6623353 | <gh_stars>0
from .debug import kotDebug | from .debug import kotDebug | none | 1 | 1.034956 | 1 | |
Tools/migrate3d.py | SanTelva/Crystal3D | 0 | 6623354 | import sys
sys.path += ['..']
from draw2.nboio import *
from draw2.nbolib import *
from draw2._legacy.igorio import *
if len(sys.argv) < 3:
print('Usage:', sys.argv[0], 'input.igor3d output.nbo3d')
__import__('_sitebuiltins').Quitter('','')(1) # exit(1)
angleA, angleB, angleG, a, b, c, primitiveCell = myInput... | import sys
sys.path += ['..']
from draw2.nboio import *
from draw2.nbolib import *
from draw2._legacy.igorio import *
if len(sys.argv) < 3:
print('Usage:', sys.argv[0], 'input.igor3d output.nbo3d')
__import__('_sitebuiltins').Quitter('','')(1) # exit(1)
angleA, angleB, angleG, a, b, c, primitiveCell = myInput... | none | 1 | 2.370426 | 2 | |
search/main.py | Necrophote/demotvcrawl | 0 | 6623355 | <filename>search/main.py
from app import app
from db_setup import init_db, db_session
from forms import MusicSearchForm
from flask import flash, render_template, request, redirect
from models import Product
from tables import Results
init_db()
@app.route('/', methods=['GET', 'POST'])
def index():
search = ... | <filename>search/main.py
from app import app
from db_setup import init_db, db_session
from forms import MusicSearchForm
from flask import flash, render_template, request, redirect
from models import Product
from tables import Results
init_db()
@app.route('/', methods=['GET', 'POST'])
def index():
search = ... | en | 0.322625 | # display results | 2.374731 | 2 |
Server/TCP/example_client.py | listenzcc/SocketServerInPython | 0 | 6623356 | # File: example_client.py
# Aim: Define example of client connection
import socket
import threading
from . import CONFIG, tools
CONFIG.logger.debug('Define components in TCP package')
class ExampleClient(object):
def __init__(self, IP, port):
# Initialize and setup client
client = s... | # File: example_client.py
# Aim: Define example of client connection
import socket
import threading
from . import CONFIG, tools
CONFIG.logger.debug('Define components in TCP package')
class ExampleClient(object):
def __init__(self, IP, port):
# Initialize and setup client
client = s... | en | 0.845473 | # File: example_client.py # Aim: Define example of client connection # Initialize and setup client # Connet to IP:port # Report and set attributes # Listen to the server # Wait until new message is received # Start client connection to server # Say hello to server # Send [message] to server | 3.214319 | 3 |
CodeGenerator.py | rdbv/cisol | 55 | 6623357 | <filename>CodeGenerator.py
from capstone import *
from capstone.x86 import *
from Instructions import *
# Basic code..
codeC = '''
#include "environment.h"
void func() {
%s}\n
int main() {
}
'''
''' Just load bytes in desired range '''
def loadCode(filename, start, stop):
f = open(filename, 'rb')
code = ... | <filename>CodeGenerator.py
from capstone import *
from capstone.x86 import *
from Instructions import *
# Basic code..
codeC = '''
#include "environment.h"
void func() {
%s}\n
int main() {
}
'''
''' Just load bytes in desired range '''
def loadCode(filename, start, stop):
f = open(filename, 'rb')
code = ... | en | 0.709669 | # Basic code.. #include "environment.h" void func() { %s}\n int main() { } Just load bytes in desired range # Instruction lookup # Init capstone # go go go Just fill C template Every jump must have place to jump, here we check, that every jump has place, if code is self-modyifing or jumps in middle of ... | 3.019857 | 3 |
ble_client/utilities.py | bnlerner/ble_client | 0 | 6623358 | """
This module offers some utilities, in a way they are work in both Python 2 and 3
"""
from pybleno import Characteristic
import array
import sys
import traceback
import binascii
import logging
from struct import unpack
import queue as queue
log = logging.getLogger(__name__)
queue = queue # just to use it
class ... | """
This module offers some utilities, in a way they are work in both Python 2 and 3
"""
from pybleno import Characteristic
import array
import sys
import traceback
import binascii
import logging
from struct import unpack
import queue as queue
log = logging.getLogger(__name__)
queue = queue # just to use it
class ... | en | 0.788593 | This module offers some utilities, in a way they are work in both Python 2 and 3 # just to use it Check that we got size bytes, if so, unpack using pattern # we need it for python 2+3 compatibility # if sys.version_info[0] == 3: # data = bytes(data, 'ascii') | 2.429798 | 2 |
conda_hooks/env_store.py | f-koehler/conda-hooks | 1 | 6623359 | <reponame>f-koehler/conda-hooks
from __future__ import annotations
import argparse
import logging
import os
from pathlib import Path
from typing import Sequence
from .environment import ENV_DEFAULT_PATHS, EnvironmentFile
from .errors import CondaHookError, EnvFileNotFoundError, NoEnvFileError, NotAFileError
logging.... | from __future__ import annotations
import argparse
import logging
import os
from pathlib import Path
from typing import Sequence
from .environment import ENV_DEFAULT_PATHS, EnvironmentFile
from .errors import CondaHookError, EnvFileNotFoundError, NoEnvFileError, NotAFileError
logging.basicConfig(level=os.environ.get... | none | 1 | 2.429463 | 2 | |
Test/FunctionalTests/FsmEditorTestScripts/ExpectedFailureNoSuccessMessage.py | jethac/ATF | 821 | 6623360 | <gh_stars>100-1000
#Copyright (c) 2014 Sony Computer Entertainment America LLC. See License.txt.
import sys
sys.path.append("./CommonTestScripts")
import Test
Test.Equal(1, 1)
Test.Equal(2, 2)
#Intentionally commented, we want this script to fail
#print Test.SUCCESS | #Copyright (c) 2014 Sony Computer Entertainment America LLC. See License.txt.
import sys
sys.path.append("./CommonTestScripts")
import Test
Test.Equal(1, 1)
Test.Equal(2, 2)
#Intentionally commented, we want this script to fail
#print Test.SUCCESS | en | 0.661123 | #Copyright (c) 2014 Sony Computer Entertainment America LLC. See License.txt. #Intentionally commented, we want this script to fail #print Test.SUCCESS | 1.363355 | 1 |
Python/files/sortsvnls.py | ebouaziz/miscripts | 0 | 6623361 | <reponame>ebouaziz/miscripts
#!/usr/bin/env python2.7
# Deal with various SVN date output to sort SVN ls by date
import re
import sys
from datetime import timedelta
from time import localtime, mktime, strptime, time
svncre = re.compile(r'\s*(?P<rev>\d+)\s+(?P<author>\w+)\s+'
r'(?:(?P<mdate>\w{3}\... | #!/usr/bin/env python2.7
# Deal with various SVN date output to sort SVN ls by date
import re
import sys
from datetime import timedelta
from time import localtime, mktime, strptime, time
svncre = re.compile(r'\s*(?P<rev>\d+)\s+(?P<author>\w+)\s+'
r'(?:(?P<mdate>\w{3}\s\d{2}\s\d{2}:\d{2})|'
... | en | 0.759126 | #!/usr/bin/env python2.7 # Deal with various SVN date output to sort SVN ls by date | 2.91333 | 3 |
kaggleQuora.py | Hyagoro/Quora_Question_Pairs | 0 | 6623362 | <reponame>Hyagoro/Quora_Question_Pairs
import gensim
import csv
from pyemd import emd
import numpy as np
from sklearn.metrics import classification_report
from sklearn.model_selection import train_test_split
from sklearn.neural_network import MLPClassifier
from sklearn import preprocessing
from itertools import islice
... | import gensim
import csv
from pyemd import emd
import numpy as np
from sklearn.metrics import classification_report
from sklearn.model_selection import train_test_split
from sklearn.neural_network import MLPClassifier
from sklearn import preprocessing
from itertools import islice
from sklearn.decomposition import PCA
i... | en | 0.480115 | # merge with toto.py to continue the training # model = gensim.models.Word2Vec(sentences, size=100, window=5, min_count=5, workers=4) # model = gensim.models.Word2Vec \ # .load_word2vec_format('/home/steve/Downloads/GoogleNews-vectors-negative300.bin.gz', binary=True) # # toto = model.most_similar(positive=['woman'... | 2.559861 | 3 |
tkinter/__canvas__/canvas-scrollbar/main.py | whitmans-max/python-examples | 140 | 6623363 | <reponame>whitmans-max/python-examples
import tkinter as tk
# date: 2019.05.01
# author: Bartłomiej 'furas' Burek
# You have to add something to canvas to use scrollbar.
# You have to use `scrollregion=` after you put items in canvas
# or you can use `after` to do it after tkinter shows window.
#def resize():
# ... | import tkinter as tk
# date: 2019.05.01
# author: Bartłomiej 'furas' Burek
# You have to add something to canvas to use scrollbar.
# You have to use `scrollregion=` after you put items in canvas
# or you can use `after` to do it after tkinter shows window.
#def resize():
# canvas.configure(scrollregion=canvas.bb... | en | 0.703731 | # date: 2019.05.01 # author: Bartłomiej 'furas' Burek # You have to add something to canvas to use scrollbar. # You have to use `scrollregion=` after you put items in canvas # or you can use `after` to do it after tkinter shows window. #def resize(): # canvas.configure(scrollregion=canvas.bbox("all")) #root.after(1... | 4.052551 | 4 |
djangopypi2/apps/pypi_metadata/models.py | MediaMath/djangopypi2 | 12 | 6623364 | <reponame>MediaMath/djangopypi2
from django.db import models
from django.utils.translation import ugettext_lazy as _
def ClassifierSerializer(o):
if isinstance(o, Classifier):
return o.name
return o
class Classifier(models.Model):
name = models.CharField(max_length=255, primary_key=True)
clas... | from django.db import models
from django.utils.translation import ugettext_lazy as _
def ClassifierSerializer(o):
if isinstance(o, Classifier):
return o.name
return o
class Classifier(models.Model):
name = models.CharField(max_length=255, primary_key=True)
class Meta:
verbose_name = _... | none | 1 | 2.259209 | 2 | |
tools_plot/plt_training_surv.py | rbn42/LearningToDrive | 1 | 6623365 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""Greeter.
Usage:
launcher.py <path>
Options:
-h --help Show this screen.
"""
from docopt import docopt
arguments = docopt(__doc__)
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.lines as lines
import matplotlib.transforms as mtransfo... | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""Greeter.
Usage:
launcher.py <path>
Options:
-h --help Show this screen.
"""
from docopt import docopt
arguments = docopt(__doc__)
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.lines as lines
import matplotlib.transforms as mtransfo... | en | 0.409984 | #!/usr/bin/env python # -*- coding: UTF-8 -*- Greeter. Usage: launcher.py <path> Options: -h --help Show this screen. | 2.867101 | 3 |
soundsep/core/stft/lattice.py | theunissenlab/soundsep2 | 0 | 6623366 | import warnings
from dataclasses import dataclass
from typing import List, Optional
import numpy as np
from numpy.lib.stride_tricks import sliding_window_view
from soundsep.core.utils import ceil_div
@dataclass
class Bound:
start: int
stop: int
def __sub__(self, other: int):
return Bound(self.s... | import warnings
from dataclasses import dataclass
from typing import List, Optional
import numpy as np
from numpy.lib.stride_tricks import sliding_window_view
from soundsep.core.utils import ceil_div
@dataclass
class Bound:
start: int
stop: int
def __sub__(self, other: int):
return Bound(self.s... | en | 0.797967 | # next_ = offset # while True: # yield next_ # next_ += step Scales the Lattice up relative to zero Scale the Lattice down relative to zero If scale_factor does not divide evenly into step and/or offset, does floor division but shows a warning. # TODO: enforce that the bound's starting inde Map... | 2.737004 | 3 |
project08/CodeWriter.py | keystrega55/nand2tetris | 0 | 6623367 | from pathlib import Path
from typing import List
class CodeWriter:
def __init__(self, asm_file, vm_file) -> None:
self.in_file = vm_file
self.in_file_name = Path(vm_file).stem
self.out_file = asm_file
self.out_file_name = Path(asm_file).stem
# counters for Boole... | from pathlib import Path
from typing import List
class CodeWriter:
def __init__(self, asm_file, vm_file) -> None:
self.in_file = vm_file
self.in_file_name = Path(vm_file).stem
self.out_file = asm_file
self.out_file_name = Path(asm_file).stem
# counters for Boole... | en | 0.682558 | # counters for Boolean comparisons # for function labels # load M[address] to D # check # load D to M[address] # store resolved address in R13 # address type is int # D is segment base # binary operators # arithmetic operators # Boolean operators # False # True # False # True # False # True # check # check # check # pu... | 2.950986 | 3 |
Menu.py | ruiting-chen/Escape_Room | 0 | 6623368 | <filename>Menu.py
# Date created: 19/04/10
# Date last modified: 19/04/12
# Description: Menu of Escape Room Game
# Ask for an action from user.
print("You can take 4 actions in this game:")
print("\tSearch\n\tUse\n\tTake\n\tTansform")
ask = input("\nWhat action do you want to take?").lower().strip()
if ask == "searc... | <filename>Menu.py
# Date created: 19/04/10
# Date last modified: 19/04/12
# Description: Menu of Escape Room Game
# Ask for an action from user.
print("You can take 4 actions in this game:")
print("\tSearch\n\tUse\n\tTake\n\tTansform")
ask = input("\nWhat action do you want to take?").lower().strip()
if ask == "searc... | en | 0.798805 | # Date created: 19/04/10 # Date last modified: 19/04/12 # Description: Menu of Escape Room Game # Ask for an action from user. | 3.646667 | 4 |
tests/settings.py | NyanKiyoshi/django-positions | 0 | 6623369 | SECRET_KEY = 'you_saw_nothing.'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
}
}
INSTALLED_APPS = [
'django_positions_2.apps.DjangoPositions2Config',
'tests'
]
| SECRET_KEY = 'you_saw_nothing.'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
}
}
INSTALLED_APPS = [
'django_positions_2.apps.DjangoPositions2Config',
'tests'
]
| none | 1 | 1.223713 | 1 | |
ptera/tools.py | mila-iqia/ptera | 6 | 6623370 | class Range:
def __init__(self, start=0, end=None, modulo=None):
self.start = start
self.end = end
self.modulo = modulo
def __call__(self, value):
if self.start is not None and value < self.start:
return False
if self.end is not None and value >= self.end:
... | class Range:
def __init__(self, start=0, end=None, modulo=None):
self.start = start
self.end = end
self.modulo = modulo
def __call__(self, value):
if self.start is not None and value < self.start:
return False
if self.end is not None and value >= self.end:
... | en | 0.212422 | # def __call__(self, value): # if self.trigger is None: # self.trigger = value # if value == self.trigger: # return True # elif value > self.trigger: # self.trigger += self.period # return self(value) # else: # return False | 3.222095 | 3 |
tests/jupyter/test_jupyter.py | thomashopkins32/LEAP | 53 | 6623371 | <reponame>thomashopkins32/LEAP
import glob
import os
import pathlib
from nbconvert import NotebookExporter
from nbconvert.preprocessors import ExecutePreprocessor
import nbformat
import pytest
from traitlets.config import Config
def run_notebook(path, timeout=120):
"""
Execute a Jupyter Notebook and return a... | import glob
import os
import pathlib
from nbconvert import NotebookExporter
from nbconvert.preprocessors import ExecutePreprocessor
import nbformat
import pytest
from traitlets.config import Config
def run_notebook(path, timeout=120):
"""
Execute a Jupyter Notebook and return any errors that it produces.
... | en | 0.8366 | Execute a Jupyter Notebook and return any errors that it produces. :param path: path to the .ipynb file to execute :param int timeout: number of seconds to let the notebook run before we throw an exception by default. :return: a tuple (nb, errors) containing the parsed Notebook object and a list of errors,... | 2.553058 | 3 |
database/bifrost.py | aasensio/graphnet_rt | 0 | 6623372 | from lightweaver.fal import Falc82
from lightweaver.rh_atoms import H_6_atom, H_6_CRD_atom, H_3_atom, C_atom, O_atom, OI_ord_atom, Si_atom, Al_atom, CaII_atom, Fe_atom, FeI_atom, He_9_atom, He_atom, He_large_atom, MgII_atom, N_atom, Na_atom, S_atom
import lightweaver as lw
import matplotlib.pyplot as plt
import numpy a... | from lightweaver.fal import Falc82
from lightweaver.rh_atoms import H_6_atom, H_6_CRD_atom, H_3_atom, C_atom, O_atom, OI_ord_atom, Si_atom, Al_atom, CaII_atom, Fe_atom, FeI_atom, He_9_atom, He_atom, He_large_atom, MgII_atom, N_atom, Na_atom, S_atom
import lightweaver as lw
import matplotlib.pyplot as plt
import numpy a... | en | 0.340779 | # ctxRef = synth_spectrum(atmosRef, depthData=True, conserveCharge=True) # tau, T, Pe, vmicro, B, vlos, theta, azimuth, z, Pgas, rho_gas # m/s # m/s # m-3 # cmass_max = 1.8 # cmass_min = -4.0 # n = 82 # cmass = np.linspace(cmass_min, cmass_max, n) # f = int.interp1d(np.log10(atmosRef.cmass), atmosRef.temperature, bound... | 1.864111 | 2 |
01.py | hendrikjeb/Euler | 1 | 6623373 | # -*- coding: utf-8 -*-
#Problem 1 - Multiples of 3 and 5
#If we list all the natural numbers below 10 that are multiples of 3 or 5,
#we get 3, 5, 6 and 9. The sum of these multiples is 23.
#Find the sum of all the multiples of 3 or 5 below 1000.
lijst = []
z = 0
for x in xrange(1000):
if x % 3 == 0 or x % 5 == 0... | # -*- coding: utf-8 -*-
#Problem 1 - Multiples of 3 and 5
#If we list all the natural numbers below 10 that are multiples of 3 or 5,
#we get 3, 5, 6 and 9. The sum of these multiples is 23.
#Find the sum of all the multiples of 3 or 5 below 1000.
lijst = []
z = 0
for x in xrange(1000):
if x % 3 == 0 or x % 5 == 0... | en | 0.751412 | # -*- coding: utf-8 -*- #Problem 1 - Multiples of 3 and 5 #If we list all the natural numbers below 10 that are multiples of 3 or 5, #we get 3, 5, 6 and 9. The sum of these multiples is 23. #Find the sum of all the multiples of 3 or 5 below 1000. | 4.072109 | 4 |
examples/bram_example.py | Verkhovskaya/PyDL | 5 | 6623374 | <reponame>Verkhovskaya/PyDL
from pywire import *
mem = BRAM(8, 2, True, True)
bram_address = Signal(1, io="in", port="P51")
bram_write_data = Signal(8, io="in", port=["P35", "P33", "P30", "P27", "P24", "P22", "P17", "P15"])
bram_write_en = Signal(1, io="in", port="P41")
bram_read = Signal(8, io="out", port=["P134", "P... | from pywire import *
mem = BRAM(8, 2, True, True)
bram_address = Signal(1, io="in", port="P51")
bram_write_data = Signal(8, io="in", port=["P35", "P33", "P30", "P27", "P24", "P22", "P17", "P15"])
bram_write_en = Signal(1, io="in", port="P41")
bram_read = Signal(8, io="out", port=["P134", "P133", "P132", "P131", "P127"... | en | 0.139836 | #print(timing(globals(), 50, 'P56', vendor="Xilinx")) | 2.249498 | 2 |
lambda_function.py | samjeffcoat/selenium-practice-scraping | 0 | 6623375 | import smtplib
import os
import json
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
YOUTUBE_TRENDING_URL = 'https://www.youtube.com/feed/trending'
def get_driver():
options = Options()
options.binary_location = '/opt/headless-chrom... | import smtplib
import os
import json
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
YOUTUBE_TRENDING_URL = 'https://www.youtube.com/feed/trending'
def get_driver():
options = Options()
options.binary_location = '/opt/headless-chrom... | en | 0.310436 | From:{SENDER_EMAIL} To: {RECEIVER_EMAIL} Subject: {subject} {body} #create the browser #get the videos #parse the cideos # send the data over email | 2.765909 | 3 |
util/gather_training_data.py | wallywangka/pybot | 1 | 6623376 | <filename>util/gather_training_data.py<gh_stars>1-10
import os, sys
from util.core.client import Client
import numpy as np
import cv2
import mss
import argparse
import threading
import util.debug_ssd as db
def get_game_screen(sct4, client_box):
return np.array(sct4.grab(client_box))[:, :, :-1]
from pykeyboard imp... | <filename>util/gather_training_data.py<gh_stars>1-10
import os, sys
from util.core.client import Client
import numpy as np
import cv2
import mss
import argparse
import threading
import util.debug_ssd as db
def get_game_screen(sct4, client_box):
return np.array(sct4.grab(client_box))[:, :, :-1]
from pykeyboard imp... | none | 1 | 2.371397 | 2 | |
deeppixel/cam/basecam.py | r0cketr1kky/DeepPixel | 0 | 6623377 | import os
import copy
import numpy as np
from PIL import Image, ImageFilter
import matplotlib.cm as mpl_color_map
import torch
import torch.nn as nn
from torch.autograd import Variable
from torchvision import models
import matplotlib.pyplot as plt
import torchvision.transforms as transforms
import torchvision.transf... | import os
import copy
import numpy as np
from PIL import Image, ImageFilter
import matplotlib.cm as mpl_color_map
import torch
import torch.nn as nn
from torch.autograd import Variable
from torchvision import models
import matplotlib.pyplot as plt
import torchvision.transforms as transforms
import torchvision.transf... | en | 0.663923 | Find resnet layer to calculate GradCAM and GradCAM++ Args: arch: default torchvision densenet models target_layer_name (str): the name of layer with its hierarchical information. please refer to usages below. target_layer_name = 'conv1' target_layer_name = 'layer1' ... | 2.416429 | 2 |
auto_repair_saas/test_settings.py | wangonya/auto-repair-saas | 6 | 6623378 | <filename>auto_repair_saas/test_settings.py
from .settings import *
SENDGRID_SANDBOX_MODE_IN_DEBUG = True
MIDDLEWARE.remove(
'auto_repair_saas.apps.utils.middleware.CurrentUserMiddleware'
)
if os.environ.get('GITHUB_WORKFLOW'):
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postg... | <filename>auto_repair_saas/test_settings.py
from .settings import *
SENDGRID_SANDBOX_MODE_IN_DEBUG = True
MIDDLEWARE.remove(
'auto_repair_saas.apps.utils.middleware.CurrentUserMiddleware'
)
if os.environ.get('GITHUB_WORKFLOW'):
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postg... | none | 1 | 1.334785 | 1 | |
tssv/cli.py | Redmar-van-den-Berg/tssv | 1 | 6623379 | from argparse import ArgumentParser, FileType, RawDescriptionHelpFormatter
from sys import stdout
from xopen import xopen
from . import usage, version
from .tssv import tssv
def main():
"""Main entry point."""
parser = ArgumentParser(
description=usage[0], epilog=usage[1],
formatter_class=Raw... | from argparse import ArgumentParser, FileType, RawDescriptionHelpFormatter
from sys import stdout
from xopen import xopen
from . import usage, version
from .tssv import tssv
def main():
"""Main entry point."""
parser = ArgumentParser(
description=usage[0], epilog=usage[1],
formatter_class=Raw... | en | 0.917572 | Main entry point. # Have a little look in the input file to determine the file format. # Now that we we know the file format, we can open the file again and # have access to the full file content. | 2.686529 | 3 |
python/rpdb_client.py | AlexandreZani/vim_rpdb | 3 | 6623380 | <filename>python/rpdb_client.py
import json_socket
import socket
import vim
class RpdbClient(object):
def __init__(self):
self.socket_family = socket.AF_INET
self.socket_addr = ('localhost', 59000)
self.conn = None
self.jsock = None
self.cur_file = None
self.cur_line = None
def connect(s... | <filename>python/rpdb_client.py
import json_socket
import socket
import vim
class RpdbClient(object):
def __init__(self):
self.socket_family = socket.AF_INET
self.socket_addr = ('localhost', 59000)
self.conn = None
self.jsock = None
self.cur_file = None
self.cur_line = None
def connect(s... | none | 1 | 2.269921 | 2 | |
Coding/Competitive_Coding/CodeForces/0 - 1300/A_Tram.py | Phantom586/My_Codes | 0 | 6623381 | <filename>Coding/Competitive_Coding/CodeForces/0 - 1300/A_Tram.py
# Linear Kingdom has exactly one tram line. It has n stops, numbered from 1 to n in the order of tram's movement.
# At the i-th stop ai passengers exit the tram, while bi passengers enter it. The tram is empty before it arrives at
# the first stop. Also,... | <filename>Coding/Competitive_Coding/CodeForces/0 - 1300/A_Tram.py
# Linear Kingdom has exactly one tram line. It has n stops, numbered from 1 to n in the order of tram's movement.
# At the i-th stop ai passengers exit the tram, while bi passengers enter it. The tram is empty before it arrives at
# the first stop. Also,... | en | 0.916934 | # Linear Kingdom has exactly one tram line. It has n stops, numbered from 1 to n in the order of tram's movement. # At the i-th stop ai passengers exit the tram, while bi passengers enter it. The tram is empty before it arrives at # the first stop. Also, when the tram arrives at the last stop, all passengers exit so th... | 3.963816 | 4 |
client/views/group_settings.py | omerk2511/dropbox | 4 | 6623382 | <reponame>omerk2511/dropbox<filename>client/views/group_settings.py<gh_stars>1-10
from Tkinter import *
from common import Codes
from ..handlers.data import Data
from ..controllers import GroupController
class GroupSettings(Frame):
def __init__(self, parent):
Frame.__init__(self, parent)
self.pare... | from Tkinter import *
from common import Codes
from ..handlers.data import Data
from ..controllers import GroupController
class GroupSettings(Frame):
def __init__(self, parent):
Frame.__init__(self, parent)
self.parent = parent
self.elements = {}
title_frame = Frame(self)... | none | 1 | 2.789903 | 3 | |
003/day-3-1-exercise/main.py | barondandi/AppBrewery | 0 | 6623383 | <reponame>barondandi/AppBrewery<filename>003/day-3-1-exercise/main.py
# 🚨 Don't change the code below 👇
number = int(input("Which number do you want to check? "))
# 🚨 Don't change the code above 👆
#Write your code below this line 👇
remainder = number % 2
if remainder == 0:
print("This is an even number.")
e... | # 🚨 Don't change the code below 👇
number = int(input("Which number do you want to check? "))
# 🚨 Don't change the code above 👆
#Write your code below this line 👇
remainder = number % 2
if remainder == 0:
print("This is an even number.")
else:
print("This is an odd number.")
''' SOLUTION
#If the number... | en | 0.837319 | # 🚨 Don't change the code below 👇 # 🚨 Don't change the code above 👆 #Write your code below this line 👇 SOLUTION #If the number can be divided by 2 with 0 remainder. if number % 2 == 0: print("This is an even number.") #Otherwise (number cannot be divided by 2 with 0 remainder). else: print("This is an odd numb... | 4.421074 | 4 |
locale/languages/fetch-trans.py | glv2/peercoin.net | 0 | 6623384 | #GHETTO TRANSLATION FETCHER - Too lazy to figure out how the transifex client works
lang = input("Input the language shorthand: ")
resources = [
"https://www.transifex.com/projects/p/website-ppc/resource/developers-page/l/" + lang + "/download/for_use/",
"https://www.transifex.com/projects/p/website-ppc/resource/ex... | #GHETTO TRANSLATION FETCHER - Too lazy to figure out how the transifex client works
lang = input("Input the language shorthand: ")
resources = [
"https://www.transifex.com/projects/p/website-ppc/resource/developers-page/l/" + lang + "/download/for_use/",
"https://www.transifex.com/projects/p/website-ppc/resource/ex... | en | 0.77917 | #GHETTO TRANSLATION FETCHER - Too lazy to figure out how the transifex client works | 2.318869 | 2 |
lion/update.py | bikeshedder/lion | 2 | 6623385 | from collections import namedtuple
Change = namedtuple('Change', ['old', 'new'])
def update_object(obj, data, fields):
'''
Update an object by using the values from `data` limited by
the fields in `fields`. Returns a dictionary of the format
`{field_name: (old_value, new_value)}`.
'''
modifie... | from collections import namedtuple
Change = namedtuple('Change', ['old', 'new'])
def update_object(obj, data, fields):
'''
Update an object by using the values from `data` limited by
the fields in `fields`. Returns a dictionary of the format
`{field_name: (old_value, new_value)}`.
'''
modifie... | en | 0.603023 | Update an object by using the values from `data` limited by the fields in `fields`. Returns a dictionary of the format `{field_name: (old_value, new_value)}`. # FIXME smart conversion of data types | 3.762452 | 4 |
FADiff/fad/__init__.py | liuxiaoxuan97/FADiff | 0 | 6623386 | <gh_stars>0
from FADiff.fad.Gradients import Scal
from FADiff.fad.Matrices import Vect | from FADiff.fad.Gradients import Scal
from FADiff.fad.Matrices import Vect | none | 1 | 0.962504 | 1 | |
Python3/0743-Network-Delay-Time/soln.py | wyaadarsh/LeetCode-Solutions | 5 | 6623387 | class Solution:
def networkDelayTime(self, times, N, K):
"""
:type times: List[List[int]]
:type N: int
:type K: int
:rtype: int
"""
network = collections.defaultdict(dict)
for u, v, w in times:
network[u][v] = w
visit_time = {K : 0}... | class Solution:
def networkDelayTime(self, times, N, K):
"""
:type times: List[List[int]]
:type N: int
:type K: int
:rtype: int
"""
network = collections.defaultdict(dict)
for u, v, w in times:
network[u][v] = w
visit_time = {K : 0}... | en | 0.318328 | :type times: List[List[int]] :type N: int :type K: int :rtype: int | 3.177164 | 3 |
cmdb-compliance/libs/aws/com_nat.py | zjj1002/aws-cloud-cmdb-system | 0 | 6623388 | <gh_stars>0
import boto3
from libs.web_logs import ins_log
class ComplianceNatGateWayApi():
def __init__(self, session):
self.nat_list = []
# 获取ec2的client
self.nat_client = session.client('ec2')
def get_nat_gate_ways_response(self):
"""
获取返回值
:return:
"... | import boto3
from libs.web_logs import ins_log
class ComplianceNatGateWayApi():
def __init__(self, session):
self.nat_list = []
# 获取ec2的client
self.nat_client = session.client('ec2')
def get_nat_gate_ways_response(self):
"""
获取返回值
:return:
"""
r... | en | 0.604843 | # 获取ec2的client 获取返回值 :return: 获取返回值 :return: # pending | failed | available | deleting | deleted 测试接口权限等信息是否异常 :return: | 2.115448 | 2 |
classes/Player.py | WordsetterFak/Discord.py-Gaming-Bot | 10 | 6623389 | <gh_stars>1-10
class Player:
occupied_players: list[int] = [] # all players, currently in a game
def __init__(self, discord_id: int):
self.discord_id: int = discord_id
| class Player:
occupied_players: list[int] = [] # all players, currently in a game
def __init__(self, discord_id: int):
self.discord_id: int = discord_id | en | 0.989317 | # all players, currently in a game | 2.588274 | 3 |
pydnameth/routines/common.py | AaronBlare/pydnameth | 0 | 6623390 | <gh_stars>0
import plotly.graph_objs as go
import numpy as np
import pandas
def categorize_data(data):
can_cast = np.can_cast(data, float)
if can_cast:
data = data.astype(float)
else:
data = pandas.factorize(data, sort=True)[0]
data = np.array(data, dtype=float)
return data
... | import plotly.graph_objs as go
import numpy as np
import pandas
def categorize_data(data):
can_cast = np.can_cast(data, float)
if can_cast:
data = data.astype(float)
else:
data = pandas.factorize(data, sort=True)[0]
data = np.array(data, dtype=float)
return data
def is_cate... | none | 1 | 2.557193 | 3 | |
visualize_volumetric_data_on__multi_view_surf.py | ngohgia/multi_view_brain_vol | 0 | 6623391 | <gh_stars>0
import numpy as np
import matplotlib.pyplot as plt
from nilearn import surface
from nilearn.plotting import plot_surf_stat_map
from matplotlib.colors import Normalize, LinearSegmentedColormap
from matplotlib.cm import ScalarMappable, get_cmap
from matplotlib.colorbar import make_axes
def visualize_volumetr... | import numpy as np
import matplotlib.pyplot as plt
from nilearn import surface
from nilearn.plotting import plot_surf_stat_map
from matplotlib.colors import Normalize, LinearSegmentedColormap
from matplotlib.cm import ScalarMappable, get_cmap
from matplotlib.colorbar import make_axes
def visualize_volumetric_data_on__... | en | 0.690182 | Visualizing volumetric data on fsaverage surfaces for the lateral, medial, dorsal and ventral view of both hemispheres Parameters ---------- vol_img: brain image in the volumetric space, such as from the output of nilearn.image.load_img fsaverage: fsaverage surface m... | 2.637053 | 3 |
nasws/rnn/genotype.py | kcyu2014/nas-landmarkreg | 8 | 6623392 | """
genotype.py
This file should contain the definition of RNN and CNN genotype.
For CNN genotype, it also provide a function to transform the genytpe
""" | """
genotype.py
This file should contain the definition of RNN and CNN genotype.
For CNN genotype, it also provide a function to transform the genytpe
""" | en | 0.76839 | genotype.py This file should contain the definition of RNN and CNN genotype. For CNN genotype, it also provide a function to transform the genytpe | 1.545927 | 2 |
mnultitool/interpolate/spline.py | artus9033/MNultitool | 3 | 6623393 | <gh_stars>1-10
from typing import Tuple
import numpy as np
from ..misc.utils import isType
def firstOrderSpline(x: np.ndarray, y: np.ndarray):
"""
Computes the coefficients of a first order spline, according to the formulas:
.. math::
a_k=\\frac{y_{k+1}-y_k}{x_{k+1}-x_k}
.. math::
b_... | from typing import Tuple
import numpy as np
from ..misc.utils import isType
def firstOrderSpline(x: np.ndarray, y: np.ndarray):
"""
Computes the coefficients of a first order spline, according to the formulas:
.. math::
a_k=\\frac{y_{k+1}-y_k}{x_{k+1}-x_k}
.. math::
b_k=y_k-a_k*x_k
... | en | 0.497414 | Computes the coefficients of a first order spline, according to the formulas: .. math:: a_k=\\frac{y_{k+1}-y_k}{x_{k+1}-x_k} .. math:: b_k=y_k-a_k*x_k :param x: function arguments (x axis) :param y: function values (y axis) :return: the coefficients of the linear function in the t... | 3.734423 | 4 |
modeling/parse.py | vs-uulm/CoinView | 0 | 6623394 | import csv
import sys
import time
from collections import defaultdict
from tqdm import *
start = time.time()
time_type = 10**6
time_unit = "ms"
tx = defaultdict(list)
us = defaultdict(int)
unique = set()
with open(sys.argv[1],"r") as csvfile:
datareader = csv.reader(csvfile, delimiter=',')
for row in tqdm(d... | import csv
import sys
import time
from collections import defaultdict
from tqdm import *
start = time.time()
time_type = 10**6
time_unit = "ms"
tx = defaultdict(list)
us = defaultdict(int)
unique = set()
with open(sys.argv[1],"r") as csvfile:
datareader = csv.reader(csvfile, delimiter=',')
for row in tqdm(d... | none | 1 | 2.708921 | 3 | |
custom_components/airzone/innobus.py | gpulido/homeassistant-airzone | 26 | 6623395 | from enum import Enum
import logging
from typing import List, Optional
from homeassistant.components.climate import ClimateEntity
from homeassistant.components.climate.const import (
CURRENT_HVAC_COOL,
CURRENT_HVAC_HEAT,
CURRENT_HVAC_IDLE,
CURRENT_HVAC_OFF,
HVAC_MODE_AUTO,
HVAC_MODE_COOL,
H... | from enum import Enum
import logging
from typing import List, Optional
from homeassistant.components.climate import ClimateEntity
from homeassistant.components.climate.const import (
CURRENT_HVAC_COOL,
CURRENT_HVAC_HEAT,
CURRENT_HVAC_IDLE,
CURRENT_HVAC_OFF,
HVAC_MODE_AUTO,
HVAC_MODE_COOL,
H... | en | 0.631097 | Representation of a Innobus Zone. Initialize the device. Return the state attributes. Return the name of the sensor. Return the list of supported features. Return the unit of measurement that is used. Turn on. Turn off. Return hvac operation ie. heat, cool mode. Need to be one of HVAC_MODE_*. Return the list of... | 2.557014 | 3 |
PoissonDirect/PoissonDirect.py | hpkeeler/posts | 24 | 6623396 | <reponame>hpkeeler/posts
# Author: <NAME>, 2019.
# Website: hpaulkeeler.com
# Repository: github.com/hpaulkeeler/posts
#
# This program simulates Poisson random variables based
# on the direct method of using exponential inter-arrival times.
# For more details, see the post:
# hpaulkeeler.com/simulating-poisson-rando... | # Author: <NAME>, 2019.
# Website: hpaulkeeler.com
# Repository: github.com/hpaulkeeler/posts
#
# This program simulates Poisson random variables based
# on the direct method of using exponential inter-arrival times.
# For more details, see the post:
# hpaulkeeler.com/simulating-poisson-random-variables-direct-method... | en | 0.642229 | # Author: <NAME>, 2019. # Website: hpaulkeeler.com # Repository: github.com/hpaulkeeler/posts # # This program simulates Poisson random variables based # on the direct method of using exponential inter-arrival times. # For more details, see the post: # hpaulkeeler.com/simulating-poisson-random-variables-direct-method/ ... | 3.801713 | 4 |
quora-question-pairs-data-prep.py | JobQiu/keras-quora-question-pairs | 0 | 6623397 | <gh_stars>0
# coding: utf-8
# # Quora question pairs: data preparation
# ## Import packages
# In[1]:
from __future__ import print_function
import numpy as np
import csv, json
from zipfile import ZipFile
from os.path import expanduser, exists
from keras.preprocessing.text import Tokenizer
from keras.preprocessin... | # coding: utf-8
# # Quora question pairs: data preparation
# ## Import packages
# In[1]:
from __future__ import print_function
import numpy as np
import csv, json
from zipfile import ZipFile
from os.path import expanduser, exists
from keras.preprocessing.text import Tokenizer
from keras.preprocessing.sequence im... | en | 0.500954 | # coding: utf-8 # # Quora question pairs: data preparation # ## Import packages # In[1]: # ## Initialize global variables # In[2]: # ## Download and extract questions pairs data # In[3]: # ## Build tokenized word index # In[4]: # ## Download and process GloVe embeddings # In[5]: # ## Prepare word embedding matrix # In[... | 2.80207 | 3 |
hospital/migrations/0013_test_center.py | horizonltd/corona | 0 | 6623398 | # Generated by Django 2.2 on 2020-03-30 10:22
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('hospital', '0012_auto_20190502_0033'),
]
operations = [
migrations.CreateModel(
name='Test_Center',
fields=[
... | # Generated by Django 2.2 on 2020-03-30 10:22
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('hospital', '0012_auto_20190502_0033'),
]
operations = [
migrations.CreateModel(
name='Test_Center',
fields=[
... | en | 0.716802 | # Generated by Django 2.2 on 2020-03-30 10:22 | 1.774457 | 2 |
RvtCheckVersion.py | Cyril-Pop/Python-checkRvtVersion | 2 | 6623399 | import sys
from PyQt5 import QtGui, QtWidgets, QtCore
from PyQt5.QtWidgets import QApplication, QWidget, QLabel, QVBoxLayout, QLayout
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QPixmap, QFont
import os
import os.path as op
import olefile
import re
import base64
__author__ = "<NAME>"
__copyright__ ... | import sys
from PyQt5 import QtGui, QtWidgets, QtCore
from PyQt5.QtWidgets import QApplication, QWidget, QLabel, QVBoxLayout, QLayout
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QPixmap, QFont
import os
import os.path as op
import olefile
import re
import base64
__author__ = "<NAME>"
__copyright__ ... | en | 0.404637 | QLabel{
border: 4px dashed #aaa
} # # # #bfi = rvt_ole.openstream("BasicFileInfo") # internal function # Open ole file # Find png signature # encode to 64 to push in PhotoImage | 2.16983 | 2 |
test/src/lib/idol/py_mar/all/target/assembled_optional.py | lyric-com/idol | 0 | 6623400 | <reponame>lyric-com/idol
# This file was scaffold by idol_mar, but it will not be overwritten, so feel free to edit.
# This file will be regenerated if you delete it.
from ...codegen.all.target.assembled_optional import (
AllTargetAssembledOptionalSchema as AssembledOptionalSchemaCodegen,
)
class AssembledOptiona... | # This file was scaffold by idol_mar, but it will not be overwritten, so feel free to edit.
# This file will be regenerated if you delete it.
from ...codegen.all.target.assembled_optional import (
AllTargetAssembledOptionalSchema as AssembledOptionalSchemaCodegen,
)
class AssembledOptionalSchema(AssembledOptional... | en | 0.976163 | # This file was scaffold by idol_mar, but it will not be overwritten, so feel free to edit. # This file will be regenerated if you delete it. | 1.052708 | 1 |
api/migrations/0004_product_image.py | MurungaKibaara/Ecommerce-Django-Rest-API | 0 | 6623401 | <gh_stars>0
# Generated by Django 3.0.3 on 2020-03-12 08:31
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0003_category_owner'),
]
operations = [
migrations.AddField(
model_name='product',
name='image',
... | # Generated by Django 3.0.3 on 2020-03-12 08:31
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0003_category_owner'),
]
operations = [
migrations.AddField(
model_name='product',
name='image',
... | en | 0.676041 | # Generated by Django 3.0.3 on 2020-03-12 08:31 | 1.681515 | 2 |
stanfordnlp/server/__init__.py | loretoparisi/stanfordnlp | 2,859 | 6623402 | <filename>stanfordnlp/server/__init__.py
from stanfordnlp.protobuf import to_text
from stanfordnlp.protobuf import Document, Sentence, Token, IndexedWord, Span
from stanfordnlp.protobuf import ParseTree, DependencyGraph, CorefChain
from stanfordnlp.protobuf import Mention, NERMention, Entity, Relation, RelationTriple, ... | <filename>stanfordnlp/server/__init__.py
from stanfordnlp.protobuf import to_text
from stanfordnlp.protobuf import Document, Sentence, Token, IndexedWord, Span
from stanfordnlp.protobuf import ParseTree, DependencyGraph, CorefChain
from stanfordnlp.protobuf import Mention, NERMention, Entity, Relation, RelationTriple, ... | none | 1 | 1.546567 | 2 | |
metrics/__init__.py | shuvozula/eth-runner | 6 | 6623403 | <gh_stars>1-10
#!/usr/bin/env python
import threading
import time
from log.log import LOG
_EPOCH_SLEEP_SECONDS = 60
_WAKEUP_SLEEP_SECONDS = 10 * 60 # 10 mins
class AbstractMetricsCollector(threading.Thread):
"""
Base class for metrics collection. Encapsulates the behavior of data-collection, reporting and
... | #!/usr/bin/env python
import threading
import time
from log.log import LOG
_EPOCH_SLEEP_SECONDS = 60
_WAKEUP_SLEEP_SECONDS = 10 * 60 # 10 mins
class AbstractMetricsCollector(threading.Thread):
"""
Base class for metrics collection. Encapsulates the behavior of data-collection, reporting and
monitoring (Com... | en | 0.778557 | #!/usr/bin/env python # 10 mins Base class for metrics collection. Encapsulates the behavior of data-collection, reporting and monitoring (Command pattern) Starts the data collection, calls collect_metrics() for data and then inserts into InfluxDB and monitors it for abnormalities using the provided Watchdog # ca... | 2.517893 | 3 |
freelearn_by_team_alpha/freelearn/gama/urls.py | chandankeshri1812/IEEE-Megaproject | 8 | 6623404 | <gh_stars>1-10
from django.urls import path
from . import views
# from .views import video
urlpatterns = [
path('',views.index,name="index"),
path('login',views.login,name ="login"),
path('logout',views.logout,name ="logout"),
path('signup',views.signup,name ="signup"),
# *******>>>>NEE... | from django.urls import path
from . import views
# from .views import video
urlpatterns = [
path('',views.index,name="index"),
path('login',views.login,name ="login"),
path('logout',views.logout,name ="logout"),
path('signup',views.signup,name ="signup"),
# *******>>>>NEET<<<<********
... | ja | 0.222359 | # from .views import video # *******>>>>NEET<<<<******** # **********>>>>>>>>BOARDS<<<<<<<<********* # *****>>>>>>>>JEE<<<<<<<******** # *****>>>>PROFILE<<<<<****** | 1.82818 | 2 |
src/train_classifier.py | canbakiskan/neuro-inspired-defense | 0 | 6623405 | <filename>src/train_classifier.py
import time
import os
from tqdm import tqdm
import numpy as np
import logging
import torch
import torch.optim as optim
import torch.backends.cudnn as cudnn
from .models.resnet import ResNet, ResNetWide
from .models.efficientnet import EfficientNet
from .models.preact_resnet import P... | <filename>src/train_classifier.py
import time
import os
from tqdm import tqdm
import numpy as np
import logging
import torch
import torch.optim as optim
import torch.backends.cudnn as cudnn
from .models.resnet import ResNet, ResNetWide
from .models.efficientnet import EfficientNet
from .models.preact_resnet import P... | en | 0.464519 | main function to run the experiments # L = round((32 - args.defense_patchsize) / args.defense_stride + 1) # Which optimizer to be used for training # lr = scheduler.get_lr()[0] # Save model parameters | 2.039629 | 2 |
simulation_workshop/_nbdev.py | hgzech/simulation_workshop | 0 | 6623406 | <filename>simulation_workshop/_nbdev.py
# AUTOGENERATED BY NBDEV! DO NOT EDIT!
__all__ = ["index", "modules", "custom_doc_links", "git_url"]
index = {"choose": "01_simulation.ipynb",
"simulate_M3RescorlaWagner_v1": "01_simulation.ipynb",
"plot_rescorla_game": "04_interactive_session.ipynb",
... | <filename>simulation_workshop/_nbdev.py
# AUTOGENERATED BY NBDEV! DO NOT EDIT!
__all__ = ["index", "modules", "custom_doc_links", "git_url"]
index = {"choose": "01_simulation.ipynb",
"simulate_M3RescorlaWagner_v1": "01_simulation.ipynb",
"plot_rescorla_game": "04_interactive_session.ipynb",
... | en | 0.183601 | # AUTOGENERATED BY NBDEV! DO NOT EDIT! | 1.440262 | 1 |
pyteiser/wrappers/report_csvs.py | goodarzilab/pyteiser | 6 | 6623407 | import numpy as np
import pandas as pd
import argparse
from .. import IO
from .. import matchmaker
from .. import type_conversions
def handler(raw_args = None):
parser = argparse.ArgumentParser()
parser.add_argument("--rna_fastafile", help="fasta file with RNA sequences", type=str)
parser.add_argument("--... | import numpy as np
import pandas as pd
import argparse
from .. import IO
from .. import matchmaker
from .. import type_conversions
def handler(raw_args = None):
parser = argparse.ArgumentParser()
parser.add_argument("--rna_fastafile", help="fasta file with RNA sequences", type=str)
parser.add_argument("--... | en | 0.616994 | # combined_seeds_filename='/Users/student/Documents/hani/programs/pyteiser/data/combined_optimized_seeds/tarbp2/seed_optimized_100k_tarbp2_utrs_10k.bin', # combined_profiles_filename='/Users/student/Documents/hani/programs/pyteiser/data/combined_optimized_seeds/tarbp2/profiles_optimized_100k_tarbp2_utrs_10k.bin', # com... | 2.378228 | 2 |
fromimports.py | caleblevy/pyfun | 2 | 6623408 | """from everything available in Python 3.5.2"""
# Processing Services
from string import *
from re import *
from difflib import *
from textwrap import *
from unicodedata import *
from stringprep import *
from readline import *
from rlcompleter import *
# Binary Data Services
from struct import *
from codecs import *
... | """from everything available in Python 3.5.2"""
# Processing Services
from string import *
from re import *
from difflib import *
from textwrap import *
from unicodedata import *
from stringprep import *
from readline import *
from rlcompleter import *
# Binary Data Services
from struct import *
from codecs import *
... | en | 0.636387 | from everything available in Python 3.5.2 # Processing Services # Binary Data Services # Data Types # Numeric and Mathematical Modules # Functional Programming Modules # File and Directory Access # Data Persistence # Data Compression and Archiving # File Formats # Cryptographic Services # Generic Operating System Servi... | 2.013052 | 2 |
src/pyrin/globalization/datetime/services.py | wilsonGmn/pyrin | 0 | 6623409 | # -*- coding: utf-8 -*-
"""
datetime services module.
"""
from pyrin.application.services import get_component
from pyrin.globalization.datetime import DateTimePackage
def now(server=True, timezone=None):
"""
gets the current datetime based on requested timezone.
:param bool server: if set to True, serv... | # -*- coding: utf-8 -*-
"""
datetime services module.
"""
from pyrin.application.services import get_component
from pyrin.globalization.datetime import DateTimePackage
def now(server=True, timezone=None):
"""
gets the current datetime based on requested timezone.
:param bool server: if set to True, serv... | en | 0.674316 | # -*- coding: utf-8 -*- datetime services module. gets the current datetime based on requested timezone. :param bool server: if set to True, server timezone will be used. if set to False, client timezone will be used. defaults to True. :param str timezone: timez... | 3.160766 | 3 |
python/common.py | phanikumar1210/Automation | 0 | 6623410 | import boto3
import json
import logging
import sys
from sys import platform
from os.path import exists
import os
destination_path="G://Automation//terraform" | import boto3
import json
import logging
import sys
from sys import platform
from os.path import exists
import os
destination_path="G://Automation//terraform" | none | 1 | 1.511771 | 2 | |
cinemanio/core/tests/admin.py | cinemanio/backend | 4 | 6623411 | from parameterized import parameterized
# from django.test import modify_settings
from django.urls.base import reverse
from cinemanio.core.factories import MovieFactory, PersonFactory, CastFactory
from cinemanio.sites.imdb.factories import ImdbMovieFactory, ImdbPersonFactory
from cinemanio.sites.kinopoisk.factories im... | from parameterized import parameterized
# from django.test import modify_settings
from django.urls.base import reverse
from cinemanio.core.factories import MovieFactory, PersonFactory, CastFactory
from cinemanio.sites.imdb.factories import ImdbMovieFactory, ImdbPersonFactory
from cinemanio.sites.kinopoisk.factories im... | en | 0.342628 | # from django.test import modify_settings # @modify_settings(MIDDLEWARE={'remove': 'silk.middleware.SilkyMiddleware'}) # TODO: prefetch thumbnails with one extra query | 2.022157 | 2 |
dipdup/taia_x/utils.py | alvaro-alonso/taia-x | 9 | 6623412 | <filename>dipdup/taia_x/utils.py
import logging
import aiohttp
_logger = logging.getLogger(__name__)
def clean_null_bytes(string: str) -> str:
return ''.join(string.split('\x00'))
def fromhex(hexbytes: str) -> str:
string = ''
try:
string = bytes.fromhex(hexbytes).decode()
except Exception... | <filename>dipdup/taia_x/utils.py
import logging
import aiohttp
_logger = logging.getLogger(__name__)
def clean_null_bytes(string: str) -> str:
return ''.join(string.split('\x00'))
def fromhex(hexbytes: str) -> str:
string = ''
try:
string = bytes.fromhex(hexbytes).decode()
except Exception... | en | 0.656337 | Wrapped aiohttp call with preconfigured headers and logging | 2.373702 | 2 |
lambda/create_jira.py | rhythmictech/terraform-aws-rhythmic-monitoring | 1 | 6623413 | import os
import logging
import urllib
import json
import boto3
import datetime
from jira import JIRA
logger = logging.getLogger()
logger.setLevel(os.environ.get('LOG_LEVEL', logging.DEBUG))
for handler in logger.handlers:
handler.setFormatter(logging.Formatter(
'%(asctime)s [%(levelname)s](%(name)s) %(m... | import os
import logging
import urllib
import json
import boto3
import datetime
from jira import JIRA
logger = logging.getLogger()
logger.setLevel(os.environ.get('LOG_LEVEL', logging.DEBUG))
for handler in logger.handlers:
handler.setFormatter(logging.Formatter(
'%(asctime)s [%(levelname)s](%(name)s) %(m... | en | 0.915697 | # establish connection to jira receives events from SNS, see https://docs.aws.amazon.com/lambda/latest/dg/with-sns.html | 2.345658 | 2 |
nandboxbots/inmessages/InlineSearch.py | nandbox/nandboxbotsapi-py | 0 | 6623414 | import json
from nandboxbots.data.Chat import Chat
from nandboxbots.data.User import User
class InlineSearch:
__KEY_INLINE_SEARCH = "inlineSearch"
__KEY_DATE = "date"
__KEY_METHOD = "method"
__KEY_CHAT = "chat"
__KEY_FROM = "from"
__KEY_SEARCH_ID = "search_id"
__KEY_OFFSET = "offset"
... | import json
from nandboxbots.data.Chat import Chat
from nandboxbots.data.User import User
class InlineSearch:
__KEY_INLINE_SEARCH = "inlineSearch"
__KEY_DATE = "date"
__KEY_METHOD = "method"
__KEY_CHAT = "chat"
__KEY_FROM = "from"
__KEY_SEARCH_ID = "search_id"
__KEY_OFFSET = "offset"
... | none | 1 | 2.505655 | 3 | |
cycles/__init__.py | pcarolan/cycles | 0 | 6623415 | <gh_stars>0
__title__ = 'cycles'
__version__ = '0.1.0'
__author__ = '<NAME>'
__copyright__ = 'Copyright 2016 <NAME>'
from .hub import Hub
__all__ = ['Hub']
| __title__ = 'cycles'
__version__ = '0.1.0'
__author__ = '<NAME>'
__copyright__ = 'Copyright 2016 <NAME>'
from .hub import Hub
__all__ = ['Hub'] | none | 1 | 1.110821 | 1 | |
py/postit.py | schaabs/sandbox | 0 | 6623416 | <gh_stars>0
from flask import Flask, jsonify, request, abort
import json
app = Flask(__name__)
@app.route('/payload', methods=['POST'])
def create_task():
if not request.json:
abort(400)
with open('d:\\temp\\posted.json', 'a+') as file:
json.dump(request.json, file)
return jsonify(request.... | from flask import Flask, jsonify, request, abort
import json
app = Flask(__name__)
@app.route('/payload', methods=['POST'])
def create_task():
if not request.json:
abort(400)
with open('d:\\temp\\posted.json', 'a+') as file:
json.dump(request.json, file)
return jsonify(request.json), 201
... | none | 1 | 2.612899 | 3 | |
PokeType/lexer/lexer.py | Daggy1234/PokeType | 2 | 6623417 | from rply import LexerGenerator
from rply.lexer import Lexer
from typing import Dict, List
from .tokens import tokens, ignore_tokens
class PokeLexer:
lexer: LexerGenerator
tokens: Dict[str, str]
ignore_tokens: List[str]
def __init__(self):
self.lexer = LexerGenerator()
self.tokens = tokens
self.ignore_toke... | from rply import LexerGenerator
from rply.lexer import Lexer
from typing import Dict, List
from .tokens import tokens, ignore_tokens
class PokeLexer:
lexer: LexerGenerator
tokens: Dict[str, str]
ignore_tokens: List[str]
def __init__(self):
self.lexer = LexerGenerator()
self.tokens = tokens
self.ignore_toke... | none | 1 | 2.431667 | 2 | |
apps/contrib/utils/dicts.py | vicobits/django-wise | 5 | 6623418 | <reponame>vicobits/django-wise
# -*- coding: utf-8 -*-
def lower_dict_values(dict_obj):
"""It applies lower to all values of a dict."""
new_dict = {}
for key, value in dict_obj.items():
new_dict[key] = value.lower() if isinstance(value, str) else value
return new_dict
| # -*- coding: utf-8 -*-
def lower_dict_values(dict_obj):
"""It applies lower to all values of a dict."""
new_dict = {}
for key, value in dict_obj.items():
new_dict[key] = value.lower() if isinstance(value, str) else value
return new_dict | en | 0.771932 | # -*- coding: utf-8 -*- It applies lower to all values of a dict. | 4.221361 | 4 |
of_route_processor.py | lijian2020/NDNAPP | 0 | 6623419 | #!/usr/bin/python3
#
# Copyright (C) 2019 Trinity College of Dublin, the University of Dublin.
# Copyright (c) 2019 <NAME>
# Author: <NAME> <<EMAIL>>
# 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 Licen... | #!/usr/bin/python3
#
# Copyright (C) 2019 Trinity College of Dublin, the University of Dublin.
# Copyright (c) 2019 <NAME>
# Author: <NAME> <<EMAIL>>
# 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 Licen... | en | 0.756007 | #!/usr/bin/python3 # # Copyright (C) 2019 Trinity College of Dublin, the University of Dublin. # Copyright (c) 2019 <NAME> # Author: <NAME> <<EMAIL>> # 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 Licens... | 2.273679 | 2 |
kontrasto/wcag_3.py | nimasmi/kontrasto | 13 | 6623420 | <reponame>nimasmi/kontrasto<filename>kontrasto/wcag_3.py
import math
from typing import Iterable
from .convert import to_rgb
from .lookup_table import get_apca_font_styles
# Python port of: https://github.com/Myndex/SAPC-APCA/blob/master/JS/APCAonly.98e_d12e.js
def apca_contrast(background, text):
if isinstance(... | import math
from typing import Iterable
from .convert import to_rgb
from .lookup_table import get_apca_font_styles
# Python port of: https://github.com/Myndex/SAPC-APCA/blob/master/JS/APCAonly.98e_d12e.js
def apca_contrast(background, text):
if isinstance(background, str):
background = to_rgb(background)... | en | 0.598947 | # Python port of: https://github.com/Myndex/SAPC-APCA/blob/master/JS/APCAonly.98e_d12e.js # ///// MAGICAL NUMBERS /////////////////////////////// # ///// sRGB Conversion to Relative Luminance (Y) ///// # Transfer Curve (aka "Gamma") for sRGB linearization # // Simple power curve vs piecewise described in docs # // ... | 2.942755 | 3 |
swarms/behaviors/sbehaviors.py | aadeshnpn/swarm | 9 | 6623421 | """Defines all the primitive behaviors for the agents.
This file name is sbehaviors coz `s` stands for swarms.
"""
import numpy as np
from py_trees.trees import BehaviourTree
from py_trees.behaviour import Behaviour
from py_trees.composites import Sequence, Selector, Parallel
from py_trees import common, blackboard
i... | """Defines all the primitive behaviors for the agents.
This file name is sbehaviors coz `s` stands for swarms.
"""
import numpy as np
from py_trees.trees import BehaviourTree
from py_trees.behaviour import Behaviour
from py_trees.composites import Sequence, Selector, Parallel
from py_trees import common, blackboard
i... | en | 0.820848 | Defines all the primitive behaviors for the agents. This file name is sbehaviors coz `s` stands for swarms. # If there is $DISPLAY, display the plot Static class to search. This class provides a find method to search through Behavior Tree blackboard and agent content. Let this method implement search. ... | 3.150385 | 3 |
script.py | IraKorshunova/kaggle-seizure-detection | 1 | 6623422 | <filename>script.py
import os
import numpy as np
import scipy as sc
import scipy.signal
from scipy import interpolate
from scipy.io import loadmat, savemat
def get_files_paths(directory, extension):
files_with_extension = list()
for root, dirs, files in os.walk(directory):
files_with_extension += [roo... | <filename>script.py
import os
import numpy as np
import scipy as sc
import scipy.signal
from scipy import interpolate
from scipy.io import loadmat, savemat
def get_files_paths(directory, extension):
files_with_extension = list()
for root, dirs, files in os.walk(directory):
files_with_extension += [roo... | en | 0.450622 | # =========================You should split this processing into reusable functions============================ # ============================================================================================================= | 2.471315 | 2 |
app/db/base.py | SanchithHegde/decrypto-api | 0 | 6623423 | <reponame>SanchithHegde/decrypto-api
"""
Imports all the models, so that `Base` has them before being imported by Alembic.
"""
# pylint: disable=unused-import
from app.db.base_class import Base
from app.models.question import Question
from app.models.question_order_item import QuestionOrderItem
from app.models.user i... | """
Imports all the models, so that `Base` has them before being imported by Alembic.
"""
# pylint: disable=unused-import
from app.db.base_class import Base
from app.models.question import Question
from app.models.question_order_item import QuestionOrderItem
from app.models.user import User | en | 0.931598 | Imports all the models, so that `Base` has them before being imported by Alembic. # pylint: disable=unused-import | 1.650393 | 2 |
PassPredict.py | Krytic/PassPredict | 7 | 6623424 | <reponame>Krytic/PassPredict
import time
import twitter
import arrow
import requests
import os, random
from orbit_predictor.sources import EtcTLESource
from orbit_predictor.locations import NZ2
from orbit_predictor.predictors.base import Position
import configparser
import cartopy.crs as ccrs
import matplotlib.pyplot a... | import time
import twitter
import arrow
import requests
import os, random
from orbit_predictor.sources import EtcTLESource
from orbit_predictor.locations import NZ2
from orbit_predictor.predictors.base import Position
import configparser
import cartopy.crs as ccrs
import matplotlib.pyplot as plt
from apscheduler.schedu... | en | 0.606501 | Download the TLE files from celestrak. Returns ------- None. Generate a connection to the twitter API. Raises ------ Exception If the validation with twitter failed. Typically this is due to an incorrect consumer key, etc. Returns ------- api : twitter.api.Api ... | 2.547455 | 3 |
Basic programs/ascending.py | gurusabarish/python-programs | 2 | 6623425 | lst=[]
n=int(input("Enter how many elements want to insert in list :"))
for i in range(n):
a=int(input())
lst.append(a)
for i in range(n):
for j in range(n):
if lst[i]<=lst[j]:
lst[i],lst[j]=lst[j],lst[i]
print("Asending order of the list :")
for i in lst:
print(i)
| lst=[]
n=int(input("Enter how many elements want to insert in list :"))
for i in range(n):
a=int(input())
lst.append(a)
for i in range(n):
for j in range(n):
if lst[i]<=lst[j]:
lst[i],lst[j]=lst[j],lst[i]
print("Asending order of the list :")
for i in lst:
print(i)
| none | 1 | 3.941313 | 4 | |
K means clustering/color_conpression.py | rpotter12/Learn_Machine-Learning | 0 | 6623426 | <gh_stars>0
import matplotlib.pyplot as plt
import seaborn as sns; sns.set()
import numpy as np
from sklearn.datasets import load_sample_image
china = load_sample_image("flower.jpg")
ax=plt.axes(xticks=[], yticks=[])
print(ax.imshow(china))
print(china.shape)
data=china/255 # use 0...1 scale
data = data.reshape(427*... | import matplotlib.pyplot as plt
import seaborn as sns; sns.set()
import numpy as np
from sklearn.datasets import load_sample_image
china = load_sample_image("flower.jpg")
ax=plt.axes(xticks=[], yticks=[])
print(ax.imshow(china))
print(china.shape)
data=china/255 # use 0...1 scale
data = data.reshape(427*640,3)
print... | en | 0.414036 | # use 0...1 scale # choose random subset #fix numpy issues | 2.910125 | 3 |
dictionary.py | VersatileVishal/Dictionary | 2 | 6623427 | <reponame>VersatileVishal/Dictionary
import json
from difflib import get_close_matches
data = json.load(open("data.json"))
def translate(word):
word = word.lower()
if word in data:
return data[word]
elif word.title() in data:
return data[word.title()]
elif word.upper() in da... | import json
from difflib import get_close_matches
data = json.load(open("data.json"))
def translate(word):
word = word.lower()
if word in data:
return data[word]
elif word.title() in data:
return data[word.title()]
elif word.upper() in data:
return data[word.upper()... | none | 1 | 3.704291 | 4 | |
testtf.py | MaxKinny/kaggle_SMILE-Kinship-Recognizing | 1 | 6623428 | <gh_stars>1-10
# -*- coding: utf-8 -*-
import tensorflow as tf
sess = tf.Session()
a = tf.constant(1)
b = tf.constant(2)
print(sess.run(a+b))
| # -*- coding: utf-8 -*-
import tensorflow as tf
sess = tf.Session()
a = tf.constant(1)
b = tf.constant(2)
print(sess.run(a+b)) | en | 0.769321 | # -*- coding: utf-8 -*- | 2.849198 | 3 |
wagtail_webstories/markup.py | sebastianbenz/wagtail-webstories | 9 | 6623429 | <filename>wagtail_webstories/markup.py
import re
from django.apps import apps
from django.utils.html import escape
from django.utils.safestring import mark_safe
from wagtail.images import get_image_model_string
from wagtail.images.shortcuts import get_rendition_or_not_found
# Retrieve the (possibly custom) image model... | <filename>wagtail_webstories/markup.py
import re
from django.apps import apps
from django.utils.html import escape
from django.utils.safestring import mark_safe
from wagtail.images import get_image_model_string
from wagtail.images.shortcuts import get_rendition_or_not_found
# Retrieve the (possibly custom) image model... | en | 0.706935 | # Retrieve the (possibly custom) image model. Can't use get_image_model as of Wagtail 2.11, as we # need require_ready=False: https://github.com/wagtail/wagtail/pull/6568 \bdata-wagtail-image-id=["'](\d+)["'] \bdata-wagtail-media-id=["'](\d+)["'] Expand symbolic references in a string of AMP markup - e.g. convert d... | 2.296018 | 2 |
tkm/main_widgets.py | Inno97/tkm | 0 | 6623430 | <filename>tkm/main_widgets.py
import tkinter as tk
from tkinter import *
class GUI:
"""The GUI class for an app.
"""
def __init__(self, title, geometry, maxsize):
"""
Args:
title (string): The title of the GUI.
geometry (string): The string of 'AxB', where A and B ar... | <filename>tkm/main_widgets.py
import tkinter as tk
from tkinter import *
class GUI:
"""The GUI class for an app.
"""
def __init__(self, title, geometry, maxsize):
"""
Args:
title (string): The title of the GUI.
geometry (string): The string of 'AxB', where A and B ar... | en | 0.826123 | The GUI class for an app. Args: title (string): The title of the GUI. geometry (string): The string of 'AxB', where A and B are the X and Y size of the GUI respectively. maxsize (List): The Tuple of ints of the maximum X, Y size of the GUI. Adds a Widget object to the F... | 4.036814 | 4 |
index/entity.py | livi2000/FundSpider | 3 | 6623431 | <reponame>livi2000/FundSpider
# -*- coding: utf-8 -*-
__author__ = 'study_sun'
import sys
from spider_base.entity import *
reload(sys)
sys.setdefaultencoding('utf-8')
#因为获取数据所限,指数没有太多数据结构
class IndexInfo(SBObject):
CODE_KEY = u'code'
CODE_CHINESE_KEY= u"指数编号"
FULL_CODE_KEY = u'full_code'
FULL_CODE_CH... | # -*- coding: utf-8 -*-
__author__ = 'study_sun'
import sys
from spider_base.entity import *
reload(sys)
sys.setdefaultencoding('utf-8')
#因为获取数据所限,指数没有太多数据结构
class IndexInfo(SBObject):
CODE_KEY = u'code'
CODE_CHINESE_KEY= u"指数编号"
FULL_CODE_KEY = u'full_code'
FULL_CODE_CHINESE_KEY = u'指数代码'
NAME_... | zh | 0.973458 | # -*- coding: utf-8 -*- #因为获取数据所限,指数没有太多数据结构 #就是 399978 #形如000001.XSHG,有的地方接口非要这个 #编制方式,一般是个url #指数成分股,处于合理性考虑,不可能将一个指数的每日的成分股都记录下来,过于冗余了,目前的想法有两个,一种是记录每个成分股的纳入和剔除日期 #一种是记录成分股变化日及所有的成分股 | 2.345886 | 2 |
apisql/blueprint.py | dataspot/apisql | 0 | 6623432 | import codecs
import os
import csv
import urllib
import tempfile
from io import StringIO
from flask import Blueprint, Response, request, send_file, abort
from flask_jsonpify import jsonpify
import xlsxwriter
from .controllers import Controllers
from .logger import logger, logging
MAX_ROWS = int(os.environ.get('APIS... | import codecs
import os
import csv
import urllib
import tempfile
from io import StringIO
from flask import Blueprint, Response, request, send_file, abort
from flask_jsonpify import jsonpify
import xlsxwriter
from .controllers import Controllers
from .logger import logger, logging
MAX_ROWS = int(os.environ.get('APIS... | en | 0.567026 | # Create a default value here in case this parameter is not provided # Encode the filename in utf-8 and url encoding | 2.541344 | 3 |
bullhorn/pipeline_methods/pre.py | jjorissen52/python-bullhorn | 0 | 6623433 | import ast
import time
import logging
from bullhorn.api.exceptions import APICallError
REST_API_PARAMS = "command method entity select_fields start sort count query entity_id_str body where".split(" ")
VALID_COMMANDS = ['search', 'query', 'entity', 'entityFiles']
ENTITY_ID_REQUIRED_METHODS = ['UPDATE', 'DELETE']
VALI... | import ast
import time
import logging
from bullhorn.api.exceptions import APICallError
REST_API_PARAMS = "command method entity select_fields start sort count query entity_id_str body where".split(" ")
VALID_COMMANDS = ['search', 'query', 'entity', 'entityFiles']
ENTITY_ID_REQUIRED_METHODS = ['UPDATE', 'DELETE']
VALI... | ro | 0.095283 | # implicit_and.append() | 2.344216 | 2 |
src/cagefight/cagefighter.py | tgates42/cagefight | 0 | 6623434 | """
The base fighter implementation
"""
from __future__ import absolute_import, print_function, division
import os
import json
class CageFighter(object):
"""
Base fighter implementation
"""
colours = [
(55, 255, 255, 255),
(255, 55, 255, 255),
(255, 255, 55, 255),
(55,... | """
The base fighter implementation
"""
from __future__ import absolute_import, print_function, division
import os
import json
class CageFighter(object):
"""
Base fighter implementation
"""
colours = [
(55, 255, 255, 255),
(255, 55, 255, 255),
(255, 255, 55, 255),
(55,... | en | 0.807011 | The base fighter implementation Base fighter implementation Called prior to the first render to prepare the starting state. Progress the game state to the next tick. Override to save details of current fighter with total knowledge Override to save details of current fighter with fighter knowledge, default imple... | 3.014819 | 3 |
Convert Sorted List to Binary Search Tree.py | sugia/leetcode | 0 | 6623435 | <filename>Convert Sorted List to Binary Search Tree.py
'''
Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.
For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the two subtrees of every node never differ by more ... | <filename>Convert Sorted List to Binary Search Tree.py
'''
Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.
For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the two subtrees of every node never differ by more ... | en | 0.762339 | Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST. For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the two subtrees of every node never differ by more than 1. Example: Given the sorted linked list: [-10,-3,0,... | 4.227838 | 4 |
openstack_app/bin/api/authentication.py | GSLabDev/openstack-app-for-splunk | 2 | 6623436 | <gh_stars>1-10
'''
Openstack App for Splunk
Copyright (c) 2017, Great Software Laboratory Private Limited.
All rights reserved.
Contributor: <NAME> [<EMAIL>], <NAME> [<EMAIL>]
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are m... | '''
Openstack App for Splunk
Copyright (c) 2017, Great Software Laboratory Private Limited.
All rights reserved.
Contributor: <NAME> [<EMAIL>], <NAME> [<EMAIL>]
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redis... | en | 0.726815 | Openstack App for Splunk Copyright (c) 2017, Great Software Laboratory Private Limited. All rights reserved. Contributor: <NAME> [<EMAIL>], <NAME> [<EMAIL>] Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistribu... | 1.139701 | 1 |
sacrerouge/data/eval_instance.py | danieldeutsch/decomposed-rouge | 81 | 6623437 | <gh_stars>10-100
import jsons
from sacrerouge.data.fields import Fields
class EvalInstance(object):
def __init__(self,
instance_id: str,
summarizer_id: str,
summarizer_type: str,
fields: Fields) -> None:
self.instance_id = instance_id
... | import jsons
from sacrerouge.data.fields import Fields
class EvalInstance(object):
def __init__(self,
instance_id: str,
summarizer_id: str,
summarizer_type: str,
fields: Fields) -> None:
self.instance_id = instance_id
self.summar... | none | 1 | 2.530169 | 3 | |
report/insert/fits/fit.py | DunstanBecht/lpa-workspace | 0 | 6623438 | #!/usr/bin/env python
# coding: utf-8
from lpa.output import analyze
stm = '100_rho5e13m-2_square_3200nm_RDD_d5e-5nm-2_edge_S0_PBC1_output'
ttl = r"100 RDD $ \left( d = 5 \times 10^{-4} \mathrm{nm^{-2}} \right) $"
impdir = '../output'
analyze.export(stm, impdir=impdir, figttl=ttl, fmtfit='pdf')
| #!/usr/bin/env python
# coding: utf-8
from lpa.output import analyze
stm = '100_rho5e13m-2_square_3200nm_RDD_d5e-5nm-2_edge_S0_PBC1_output'
ttl = r"100 RDD $ \left( d = 5 \times 10^{-4} \mathrm{nm^{-2}} \right) $"
impdir = '../output'
analyze.export(stm, impdir=impdir, figttl=ttl, fmtfit='pdf')
| en | 0.325294 | #!/usr/bin/env python # coding: utf-8 | 1.474797 | 1 |
soiq_keys.py | lizmat/soiqbot | 9 | 6623439 | twitter_consumer_key = ''
twitter_consumer_secret = ''
twitter_token_key = ''
twitter_token_secret = ''
so_client_secret = ''
so_key = ''
| twitter_consumer_key = ''
twitter_consumer_secret = ''
twitter_token_key = ''
twitter_token_secret = ''
so_client_secret = ''
so_key = ''
| none | 1 | 1.013278 | 1 | |
rpython/translator/platform/freebsd.py | nanjekyejoannah/pypy | 381 | 6623440 | """Support for FreeBSD."""
import os
from rpython.translator.platform.bsd import BSD
class Freebsd(BSD):
name = "freebsd"
link_flags = tuple(
['-pthread'] +
os.environ.get('LDFLAGS', '').split())
cflags = tuple(
['-O3', '-pthread', '-fomit-frame-pointer'] +
os.environ.get(... | """Support for FreeBSD."""
import os
from rpython.translator.platform.bsd import BSD
class Freebsd(BSD):
name = "freebsd"
link_flags = tuple(
['-pthread'] +
os.environ.get('LDFLAGS', '').split())
cflags = tuple(
['-O3', '-pthread', '-fomit-frame-pointer'] +
os.environ.get(... | en | 0.766899 | Support for FreeBSD. | 2.048373 | 2 |
tests/test_field.py | saxix/django-regex | 3 | 6623441 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import re
import pytest
from django.core.exceptions import ValidationError
from django.db import connection
from django_regex.fields import RegexField
from django_regex.forms import RegexFormField, compress
pytestmark = pytest.mark.dja... | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import re
import pytest
from django.core.exceptions import ValidationError
from django.db import connection
from django_regex.fields import RegexField
from django_regex.forms import RegexFormField, compress
pytestmark = pytest.mark.dja... | en | 0.769321 | # -*- coding: utf-8 -*- | 2.202442 | 2 |
Lang/Python/py_base/data_structure/graph/graph.py | Orig5826/Basics | 5 | 6623442 |
from pydotplus import Dot, Node, Edge
import os
# 该图配置
graph = {'A': ['B', 'C', 'F'],
'B': ['C', 'D'],
'C': ['D'],
'D': ['C'],
'E': ['F', 'D'],
'F': ['C']
}
def dotgraph(graph):
__graph = Dot(rankdir='TB', fontname="Fangsong",
fontcolor='bl... |
from pydotplus import Dot, Node, Edge
import os
# 该图配置
graph = {'A': ['B', 'C', 'F'],
'B': ['C', 'D'],
'C': ['D'],
'D': ['C'],
'E': ['F', 'D'],
'F': ['C']
}
def dotgraph(graph):
__graph = Dot(rankdir='TB', fontname="Fangsong",
fontcolor='bl... | zh | 0.884514 | # 该图配置 # 若节点没有特殊label或者其他属性需求 # 可以直接以节点名称显示 # 直接标记方向,不用手动添加 # node = Node(key) # __graph.add_node(node) # ret = __graph.write_png("demo.png") # if ret is not True: # print('生成graph.png失败') 在图graph中找路径: 从顶点start到顶点end 走过的路径为path # 3.0 若当找到路径尾部,则返回该路径 # 1.0 判断当前顶点是否在图内 # 2.0 以当前顶点为起点,继续找路径 # 4.0 返回该路径... | 2.905657 | 3 |
src/components/base.py | Mrpatekful/Pytorch-MT | 7 | 6623443 | <filename>src/components/base.py
from torch.nn import Module
from src.utils.utils import Component
class Encoder(Module, Component):
"""
Abstract base class for the encoder modules of the application. An encoder must
inherit from this class, otherwise it won't be discoverable by the hierarchy
builder... | <filename>src/components/base.py
from torch.nn import Module
from src.utils.utils import Component
class Encoder(Module, Component):
"""
Abstract base class for the encoder modules of the application. An encoder must
inherit from this class, otherwise it won't be discoverable by the hierarchy
builder... | en | 0.874477 | Abstract base class for the encoder modules of the application. An encoder must inherit from this class, otherwise it won't be discoverable by the hierarchy builder utility. Abstract base class for the decoder modules of the application. A decoder must inherit from this class, otherwise it won't be discover... | 2.644761 | 3 |
ivory/lightgbm/estimator.py | daizutabi/ivory | 1 | 6623444 | <gh_stars>1-10
import lightgbm as lgb
import ivory.core.estimator
from ivory.core import instance
from ivory.core.run import Run
class Estimator(ivory.core.estimator.Estimator):
def __init__(self, **kwargs):
self.params, self.kwargs = instance.filter_params(lgb.train, **kwargs)
def step(self, run: R... | import lightgbm as lgb
import ivory.core.estimator
from ivory.core import instance
from ivory.core.run import Run
class Estimator(ivory.core.estimator.Estimator):
def __init__(self, **kwargs):
self.params, self.kwargs = instance.filter_params(lgb.train, **kwargs)
def step(self, run: Run, mode: str):... | it | 0.408888 | # type:ignore | 2.354751 | 2 |
setup.py | nguyentientungduong/python_client | 0 | 6623445 | <gh_stars>0
#!/usr/bin/env python
"""
setup.py file for GridDB python client
"""
from distutils.command.build import build
import os
import platform, sysconfig
try:
from setuptools import setup, Extension
except ImportError:
from distutils.core import setup, Extension
try:
with open('README.rst') as f:
... | #!/usr/bin/env python
"""
setup.py file for GridDB python client
"""
from distutils.command.build import build
import os
import platform, sysconfig
try:
from setuptools import setup, Extension
except ImportError:
from distutils.core import setup, Extension
try:
with open('README.rst') as f:
read... | en | 0.29832 | #!/usr/bin/env python setup.py file for GridDB python client # For MacOS # For MacOS #f"c_client-{cclient_version}/bin/libgridstore.0.0.0.dylib", #f"c_client-{cclient_version}/bin/libgridstore.0.dylib", #f"c_client-{cclient_version}/bin/libgridstore.dylib" | 1.677372 | 2 |
examples/simplest.py | wilfredinni/mary | 4 | 6623446 | """
Very basic example that show how to build a simple CLI.
"""
import noodle
class Main(noodle.Master):
"""
Simple CLI app written with Noodle.
"""
app_name = "Simplest" # if not specified, defaults to the filename
version = "0.1.1" # if not specified, defaults to 0.1.0
class Greet(noodle.Co... | """
Very basic example that show how to build a simple CLI.
"""
import noodle
class Main(noodle.Master):
"""
Simple CLI app written with Noodle.
"""
app_name = "Simplest" # if not specified, defaults to the filename
version = "0.1.1" # if not specified, defaults to 0.1.0
class Greet(noodle.Co... | en | 0.629919 | Very basic example that show how to build a simple CLI. Simple CLI app written with Noodle. # if not specified, defaults to the filename # if not specified, defaults to 0.1.0 Greets someone | 3.509338 | 4 |
platipy/dicom/tests/test_convert_rtstruct.py | SimonBiggs/platipy | 0 | 6623447 | # Copyright 2020 University of New South Wales, University of Sydney, Ingham Institute
# 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
# Unle... | # Copyright 2020 University of New South Wales, University of Sydney, Ingham Institute
# 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
# Unle... | en | 0.833968 | # Copyright 2020 University of New South Wales, University of Sydney, Ingham Institute # 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.055789 | 2 |
pyxel/editor/__init__.py | grewn0uille/pyxel | 1 | 6623448 | <filename>pyxel/editor/__init__.py
from . import canvas_expansion # noqa: F401
from .app import App # noqa: F401
| <filename>pyxel/editor/__init__.py
from . import canvas_expansion # noqa: F401
from .app import App # noqa: F401
| uz | 0.476978 | # noqa: F401 # noqa: F401 | 0.951236 | 1 |
crypt/gamma_cipher.py | 5x/cryptography-gui-app | 1 | 6623449 | <filename>crypt/gamma_cipher.py
from random import Random
from crypt.trithemius_cipher import TrithemiusCipher, TrithemiusHandleABC
from crypt.cipher_abc import CipherABC
class SimplePRNG(TrithemiusHandleABC):
SHIFT_C1 = 53
def __init__(self, symbols_collection, key, *args, **kwargs):
super().__init... | <filename>crypt/gamma_cipher.py
from random import Random
from crypt.trithemius_cipher import TrithemiusCipher, TrithemiusHandleABC
from crypt.cipher_abc import CipherABC
class SimplePRNG(TrithemiusHandleABC):
SHIFT_C1 = 53
def __init__(self, symbols_collection, key, *args, **kwargs):
super().__init... | none | 1 | 3.029503 | 3 | |
odp/lib/auth.py | SAEONData/Open-Data-Platform | 2 | 6623450 | from dataclasses import dataclass
from typing import Union, Set, Literal, Dict, Optional, List
from odp.db import Session
from odp.db.models import User, Client
from odp.lib import exceptions as x
@dataclass
class Authorization:
"""An Authorization object represents the effective set of permissions
for a use... | from dataclasses import dataclass
from typing import Union, Set, Literal, Dict, Optional, List
from odp.db import Session
from odp.db.models import User, Client
from odp.lib import exceptions as x
@dataclass
class Authorization:
"""An Authorization object represents the effective set of permissions
for a use... | en | 0.878787 | An Authorization object represents the effective set of permissions for a user or a client. It consists of a dictionary of scope ids (OAuth2 scope identifiers), where the value for each id is either: - '*' if the scope is applicable across all relevant platform entities; or - a set of provider ids to w... | 2.970142 | 3 |