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
sandbox/pdp2/arbitrary_data/zip_files.py
projectpai/paipass
3
5200
import zipfile import random RAND_INT_RANGE = (1,100) def wrf(fname): with open(fname, 'w') as f: for i in range(100): f.write(str(random.randint(*RAND_INT_RANGE))) fnames = [] for i in range(10): fname = 'file' + str(i) + '.txt' wrf(fname) fnames.append(fname) dirpaths = set() wi...
import zipfile import random RAND_INT_RANGE = (1,100) def wrf(fname): with open(fname, 'w') as f: for i in range(100): f.write(str(random.randint(*RAND_INT_RANGE))) fnames = [] for i in range(10): fname = 'file' + str(i) + '.txt' wrf(fname) fnames.append(fname) dirpaths = set() wi...
en
0.892941
# let's not have duplicate dirpaths.
3.246497
3
tests/testproject/testproject/tests/test_middleware.py
mwesterhof/wagtail_managed404
1
5201
import unittest from django.test import Client from wagtail.core.models import Page from wagtail_managed404.models import PageNotFoundEntry class TestMiddleware(unittest.TestCase): """Tests for `wagtail_app_pages` package.""" def setUp(self): self.client = Client() self.invalid_url = '/defi...
import unittest from django.test import Client from wagtail.core.models import Page from wagtail_managed404.models import PageNotFoundEntry class TestMiddleware(unittest.TestCase): """Tests for `wagtail_app_pages` package.""" def setUp(self): self.client = Client() self.invalid_url = '/defi...
en
0.755817
Tests for `wagtail_app_pages` package.
2.465297
2
src/reversion/version.py
maraujop/django-reversion
0
5202
__version__ = (1, 8, 5)
__version__ = (1, 8, 5)
none
1
1.147227
1
observations/r/bomsoi.py
hajime9652/observations
199
5203
<gh_stars>100-1000 # -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function import csv import numpy as np import os import sys from observations.util import maybe_download_and_extract def bomsoi(path): """Southern Oscillation Index Data ...
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function import csv import numpy as np import os import sys from observations.util import maybe_download_and_extract def bomsoi(path): """Southern Oscillation Index Data The Southern Osci...
en
0.867348
# -*- coding: utf-8 -*- Southern Oscillation Index Data The Southern Oscillation Index (SOI) is the difference in barometric pressure at sea level between Tahiti and Darwin. Annual SOI and Australian rainfall data, for the years 1900-2001, are given. Australia's annual mean rainfall is an area-weighted average...
3.01082
3
openpype/hosts/houdini/plugins/publish/validate_bypass.py
dangerstudios/OpenPype
0
5204
import pyblish.api import openpype.api class ValidateBypassed(pyblish.api.InstancePlugin): """Validate all primitives build hierarchy from attribute when enabled. The name of the attribute must exist on the prims and have the same name as Build Hierarchy from Attribute's `Path Attribute` value on the Ale...
import pyblish.api import openpype.api class ValidateBypassed(pyblish.api.InstancePlugin): """Validate all primitives build hierarchy from attribute when enabled. The name of the attribute must exist on the prims and have the same name as Build Hierarchy from Attribute's `Path Attribute` value on the Ale...
en
0.745604
Validate all primitives build hierarchy from attribute when enabled. The name of the attribute must exist on the prims and have the same name as Build Hierarchy from Attribute's `Path Attribute` value on the Alembic ROP node whenever Build Hierarchy from Attribute is enabled.
2.200986
2
gavPrj/dataset_core.py
GavinK-ai/cv
1
5205
<filename>gavPrj/dataset_core.py import os import cv2 as cv import matplotlib.pyplot as plt import numpy as np #srcPaths = ('dataset/Screenshot1','dataset/Screenshot2','dataset/Screenshot3', 'dataset/Screenshot4') #srcPaths = ('all_dataset/s1', # 'all_dataset/s10', # 'all_dataset/s11', ...
<filename>gavPrj/dataset_core.py import os import cv2 as cv import matplotlib.pyplot as plt import numpy as np #srcPaths = ('dataset/Screenshot1','dataset/Screenshot2','dataset/Screenshot3', 'dataset/Screenshot4') #srcPaths = ('all_dataset/s1', # 'all_dataset/s10', # 'all_dataset/s11', ...
en
0.243446
#srcPaths = ('dataset/Screenshot1','dataset/Screenshot2','dataset/Screenshot3', 'dataset/Screenshot4') #srcPaths = ('all_dataset/s1', # 'all_dataset/s10', # 'all_dataset/s11', # 'all_dataset/s12', # 'all_dataset/s13', # 'all_dataset/s14', # 'all_dataset/s15', # 'all_dataset/s16', # 'all_dataset/s17', # 'all_dataset/s18...
2.009439
2
kronos/kronos.py
jinified/kronos
0
5206
""" Kronos: A simple scheduler for graduate training programme Entities: User, Schedule, Rotation """ from operator import itemgetter from datetime import datetime, timedelta def getRotationCapacity(rotationId, startDate, endDate, assignments): """ Calculate number of users assigned to a particular rotation dur...
""" Kronos: A simple scheduler for graduate training programme Entities: User, Schedule, Rotation """ from operator import itemgetter from datetime import datetime, timedelta def getRotationCapacity(rotationId, startDate, endDate, assignments): """ Calculate number of users assigned to a particular rotation dur...
en
0.822734
Kronos: A simple scheduler for graduate training programme Entities: User, Schedule, Rotation Calculate number of users assigned to a particular rotation during the specified duration # Weeks involved during the rotation Calculate loss function for suggested solution (negative = better) Parameters: assignm...
3.030169
3
personal_env/lib/python3.8/site-packages/pylint/lint/utils.py
jestinmwilson/personal-website
0
5207
# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/master/COPYING import contextlib import sys from pylint.utils import utils class ArgumentPreprocessingError(Exception): """Raised if an error occurs during argument prep...
# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/master/COPYING import contextlib import sys from pylint.utils import utils class ArgumentPreprocessingError(Exception): """Raised if an error occurs during argument prep...
en
0.821396
# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/master/COPYING Raised if an error occurs during argument preprocessing. look for some options (keys of <search_for>) which have to be processed before others values of <search...
2.340808
2
mol_dqn/experimental/multi_obj.py
deepneuralmachine/google-research
23,901
5208
<reponame>deepneuralmachine/google-research<gh_stars>1000+ # coding=utf-8 # Copyright 2021 The Google Research Authors. # # 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.apac...
# coding=utf-8 # Copyright 2021 The Google Research Authors. # # 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 applicab...
en
0.805366
# coding=utf-8 # Copyright 2021 The Google Research Authors. # # 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 applicab...
2.126485
2
myuw/test/views/test_rest_search.py
uw-it-aca/myuw
18
5209
# Copyright 2021 UW-IT, University of Washington # SPDX-License-Identifier: Apache-2.0 # -*- coding: utf-8 -*- from django.test.utils import override_settings from django.urls import reverse from myuw.test.api import MyuwApiTest @override_settings( RESTCLIENTS_ADMIN_AUTH_MODULE='rc_django.tests.can_proxy_restcli...
# Copyright 2021 UW-IT, University of Washington # SPDX-License-Identifier: Apache-2.0 # -*- coding: utf-8 -*- from django.test.utils import override_settings from django.urls import reverse from myuw.test.api import MyuwApiTest @override_settings( RESTCLIENTS_ADMIN_AUTH_MODULE='rc_django.tests.can_proxy_restcli...
en
0.513223
# Copyright 2021 UW-IT, University of Washington # SPDX-License-Identifier: Apache-2.0 # -*- coding: utf-8 -*- # hfs # bookstore # myplan # libraries # iasystem # uwnetid # grad # notices # upass
2.288071
2
examples/cli-solver/cli_solver.py
danagle/boggled
0
5210
<reponame>danagle/boggled # cli_solver.py import argparse import os from boggled import BoggleBoard, BoggleSolver, BoggleWords def solve_board(board, words): solver = BoggleSolver(board, words) solver.solve() return solver def display_board_details(board): print("Board details:") print("Columns...
# cli_solver.py import argparse import os from boggled import BoggleBoard, BoggleSolver, BoggleWords def solve_board(board, words): solver = BoggleSolver(board, words) solver.solve() return solver def display_board_details(board): print("Board details:") print("Columns: ", board.columns) pr...
it
0.136936
# cli_solver.py
3.383279
3
src/wepy/orchestration/orchestrator.py
gitter-badger/wepy-1
35
5211
from copy import copy, deepcopy import sqlite3 from hashlib import md5 import time import os import os.path as osp from base64 import b64encode, b64decode from zlib import compress, decompress import itertools as it import logging # instead of pickle we use dill, so we can save dynamically defined # classes import dil...
from copy import copy, deepcopy import sqlite3 from hashlib import md5 import time import os import os.path as osp from base64 import b64encode, b64decode from zlib import compress, decompress import itertools as it import logging # instead of pickle we use dill, so we can save dynamically defined # classes import dil...
en
0.807013
# instead of pickle we use dill, so we can save dynamically defined # classes # we freeze the pickle protocol for making hashes, because we care # more about stability than efficiency of newer versions # the default way to oepn up the whole parent database # mode to open the individual kv stores on the parent database ...
1.995636
2
src/generate_class_specific_samples.py
HesterLim/pytorch-cnn-visualizations
6,725
5212
""" Created on Thu Oct 26 14:19:44 2017 @author: <NAME> - github.com/utkuozbulak """ import os import numpy as np import torch from torch.optim import SGD from torchvision import models from misc_functions import preprocess_image, recreate_image, save_image class ClassSpecificImageGeneration(): """ Pro...
""" Created on Thu Oct 26 14:19:44 2017 @author: <NAME> - github.com/utkuozbulak """ import os import numpy as np import torch from torch.optim import SGD from torchvision import models from misc_functions import preprocess_image, recreate_image, save_image class ClassSpecificImageGeneration(): """ Pro...
en
0.615597
Created on Thu Oct 26 14:19:44 2017 @author: <NAME> - github.com/utkuozbulak Produces an image that maximizes a certain class with gradient ascent # Generate a random image # Create the folder to export images if not exists Generates class specific image Keyword Arguments: iterations {int} -- Tota...
2.764534
3
sumo/tools/net/visum_mapDistricts.py
iltempe/osmosi
0
5213
#!/usr/bin/env python """ @file visum_mapDistricts.py @author <NAME> @author <NAME> @date 2007-10-25 @version $Id$ This script reads a network and a dump file and draws the network, coloring it by the values found within the dump-file. SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ Copyright (...
#!/usr/bin/env python """ @file visum_mapDistricts.py @author <NAME> @author <NAME> @date 2007-10-25 @version $Id$ This script reads a network and a dump file and draws the network, coloring it by the values found within the dump-file. SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ Copyright (...
en
0.719949
#!/usr/bin/env python @file visum_mapDistricts.py @author <NAME> @author <NAME> @date 2007-10-25 @version $Id$ This script reads a network and a dump file and draws the network, coloring it by the values found within the dump-file. SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ Copyright (C) 2...
3.258067
3
BKPMediaDetector.py
bkpifc/BKPMediaDetector
5
5214
#!/usr/bin/env python3 ###### # General Detector # 06.12.2018 / Last Update: 20.05.2021 # LRB ###### import numpy as np import os import sys import tensorflow as tf import hashlib import cv2 import magic import PySimpleGUI as sg import csv import imagehash import face_recognition import subprocess from itertools impo...
#!/usr/bin/env python3 ###### # General Detector # 06.12.2018 / Last Update: 20.05.2021 # LRB ###### import numpy as np import os import sys import tensorflow as tf import hashlib import cv2 import magic import PySimpleGUI as sg import csv import imagehash import face_recognition import subprocess from itertools impo...
en
0.757225
#!/usr/bin/env python3 ###### # General Detector # 06.12.2018 / Last Update: 20.05.2021 # LRB ###### ###### # Worker function to check the input provided via the GUI ####### #Validate input # for element in gui_input[1][0:7]: # if element == '' or []: # error = True ###### # Worker function to update the pr...
1.984705
2
src/BruteForce.py
stevenwalton/Retro-Learner
0
5215
<filename>src/BruteForce.py import time import retro import FrameSkip import TimeLimit import Brute class BruteForce(): def __init__(self, game='Airstriker-Genesis', max_episode_steps=4500, timestep_limit=100_000_000, state=retro.State.DEFAULT, ...
<filename>src/BruteForce.py import time import retro import FrameSkip import TimeLimit import Brute class BruteForce(): def __init__(self, game='Airstriker-Genesis', max_episode_steps=4500, timestep_limit=100_000_000, state=retro.State.DEFAULT, ...
none
1
2.852963
3
tutorials/04-advanced/03-super-resolution-onnx/main.py
yakhyo/PyTorch-Tutorials
7
5216
import io import numpy as np import torch.utils.model_zoo as model_zoo import torch.onnx import torch.nn as nn import torch.nn.init as init # ================================================================ # # Building the Model # # ====================================...
import io import numpy as np import torch.utils.model_zoo as model_zoo import torch.onnx import torch.nn as nn import torch.nn.init as init # ================================================================ # # Building the Model # # ====================================...
en
0.693894
# ================================================================ # # Building the Model # # ================================================================ # # Creating an instance from SuperResolutionNet # ================================================================...
2.460769
2
features/steps/section.py
revvsales/python-docx-1
3,031
5217
<reponame>revvsales/python-docx-1<filename>features/steps/section.py # encoding: utf-8 """ Step implementations for section-related features """ from __future__ import absolute_import, print_function, unicode_literals from behave import given, then, when from docx import Document from docx.enum.section import WD_OR...
# encoding: utf-8 """ Step implementations for section-related features """ from __future__ import absolute_import, print_function, unicode_literals from behave import given, then, when from docx import Document from docx.enum.section import WD_ORIENT, WD_SECTION from docx.section import Section from docx.shared im...
en
0.522029
# encoding: utf-8 Step implementations for section-related features # given ==================================================== # when ===================================================== # then =====================================================
2.308356
2
scipy/sparse/csgraph/_laplacian.py
seberg/scipy
1
5218
""" Laplacian of a compressed-sparse graph """ # Authors: <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # License: BSD import numpy as np from scipy.sparse import isspmatrix, coo_matrix ############################################################################### # Graph laplacian def l...
""" Laplacian of a compressed-sparse graph """ # Authors: <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # License: BSD import numpy as np from scipy.sparse import isspmatrix, coo_matrix ############################################################################### # Graph laplacian def l...
en
0.717724
Laplacian of a compressed-sparse graph # Authors: <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # License: BSD ############################################################################### # Graph laplacian Return the Laplacian matrix of a directed graph. For non-symmetric graphs the o...
3.451085
3
zilean/system/zilean_migrator.py
A-Hilaly/zilean
0
5219
<reponame>A-Hilaly/zilean<gh_stars>0 from .utils.migrations import (migrate_database_from, migrate_machine_from, zilean_rollback_database_backup, zilean_rollback_machine_backup) class ZileanMigrator(object): pass
from .utils.migrations import (migrate_database_from, migrate_machine_from, zilean_rollback_database_backup, zilean_rollback_machine_backup) class ZileanMigrator(object): pass
none
1
1.287664
1
coltran/run.py
DionysisChristopoulos/google-research
23,901
5220
<filename>coltran/run.py # coding=utf-8 # Copyright 2021 The Google Research Authors. # # 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 # # Un...
<filename>coltran/run.py # coding=utf-8 # Copyright 2021 The Google Research Authors. # # 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 # # Un...
en
0.553944
# coding=utf-8 # Copyright 2021 The Google Research Authors. # # 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 applicab...
1.845705
2
train_multi_human.py
wenliangdai/sunets-reproduce
2
5221
<gh_stars>1-10 import argparse import math import os import pickle import random import sys import numpy as np import torch import torch.backends.cudnn as cudnn from torch import nn from torch.optim import lr_scheduler from torch.utils import data import torchvision.transforms as transforms import transforms as exten...
import argparse import math import os import pickle import random import sys import numpy as np import torch import torch.backends.cudnn as cudnn from torch import nn from torch.optim import lr_scheduler from torch.utils import data import torchvision.transforms as transforms import transforms as extended_transforms ...
en
0.467785
# paths # Set the seed for reproducing the results # Set up results folder # Setup Dataloader # Setup Model # Learning rates: For new layers (such as final layer), we set lr to be 10x the learning rate of layers already trained # optimizer = torch.optim.SGD(model.parameters(), lr=args.lr, momentum=args.momentum, weight...
2.114583
2
exemplos/exemplo-aula-14-01.py
quitaiskiluisf/TI4F-2021-LogicaProgramacao
0
5222
# Apresentação print('Programa para somar 8 valores utilizando vetores/listas') print() # Declaração do vetor valores = [0, 0, 0, 0, 0, 0, 0, 0] # Solicita os valores for i in range(len(valores)): valores[i] = int(input('Informe o valor: ')) # Cálculo da soma soma = 0 for i in range(len(valores)): soma += va...
# Apresentação print('Programa para somar 8 valores utilizando vetores/listas') print() # Declaração do vetor valores = [0, 0, 0, 0, 0, 0, 0, 0] # Solicita os valores for i in range(len(valores)): valores[i] = int(input('Informe o valor: ')) # Cálculo da soma soma = 0 for i in range(len(valores)): soma += va...
pt
0.961897
# Apresentação # Declaração do vetor # Solicita os valores # Cálculo da soma # Apresenta o resultado
4.139056
4
day3/p1.py
pwicks86/adventofcode2015
0
5223
from collections import defaultdict f = open("input.txt") d = f.read() houses = defaultdict(int,{(0,0):1}) cur = [0,0] for c in d: if c == "<": cur[0] -= 1 if c == ">": cur[0] += 1 if c == "v": cur[1] += 1 if c == "^": cur[1] -= 1 houses[tuple(cur)]+=1 print(len(hou...
from collections import defaultdict f = open("input.txt") d = f.read() houses = defaultdict(int,{(0,0):1}) cur = [0,0] for c in d: if c == "<": cur[0] -= 1 if c == ">": cur[0] += 1 if c == "v": cur[1] += 1 if c == "^": cur[1] -= 1 houses[tuple(cur)]+=1 print(len(hou...
none
1
3.046154
3
pbr/config/blend_config.py
NUbots/NUpbr
1
5224
<gh_stars>1-10 # Blender-specific Configuration Settings from math import pi render = { "render_engine": "CYCLES", "render": {"cycles_device": "GPU"}, "dimensions": {"resolution": [1280, 1024], "percentage": 100.0}, "sampling": {"cycles_samples": 256, "cycles_preview_samples": 16}, "light_paths": ...
# Blender-specific Configuration Settings from math import pi render = { "render_engine": "CYCLES", "render": {"cycles_device": "GPU"}, "dimensions": {"resolution": [1280, 1024], "percentage": 100.0}, "sampling": {"cycles_samples": 256, "cycles_preview_samples": 16}, "light_paths": { "tran...
en
0.520357
# Blender-specific Configuration Settings
1.580237
2
simglucose/controller/basal_bolus_ctrller.py
mia-jingyi/simglucose
0
5225
from .base import Controller from .base import Action import numpy as np import pandas as pd import logging from collections import namedtuple from tqdm import tqdm logger = logging.getLogger(__name__) CONTROL_QUEST = 'simglucose/params/Quest.csv' PATIENT_PARA_FILE = 'simglucose/params/vpatient_params.csv' ParamTup = ...
from .base import Controller from .base import Action import numpy as np import pandas as pd import logging from collections import namedtuple from tqdm import tqdm logger = logging.getLogger(__name__) CONTROL_QUEST = 'simglucose/params/Quest.csv' PATIENT_PARA_FILE = 'simglucose/params/vpatient_params.csv' ParamTup = ...
en
0.831684
This is a Basal-Bolus Controller that is typically practiced by a Type-1 Diabetes patient. The performance of this controller can serve as a baseline when developing a more advanced controller. # unit: g/min Helper function to compute the basal and bolus amount. The basal insulin is based on the insuli...
2.799336
3
ceilometer/event/trait_plugins.py
redhat-openstack/ceilometer
1
5226
# # Copyright 2013 Rackspace Hosting. # # 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...
# # Copyright 2013 Rackspace Hosting. # # 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...
en
0.732717
# # Copyright 2013 Rackspace Hosting. # # 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...
2.058653
2
web13/jsonapi.py
gongjunhuang/web
0
5227
<reponame>gongjunhuang/web from flask import Flask, redirect, url_for, jsonify, request app = Flask(__name__) users = [] ''' Json api 请求form里面Json 返回Json 好处: 1.通信的格式统一,对语言的约束就小了 2.易于做成open api 3.客户端重度渲染 RESTful api Dr. Fielding url 用资源来组织的 名词 /GET /players 拿到所有玩家 /GET /player/id 访问i...
from flask import Flask, redirect, url_for, jsonify, request app = Flask(__name__) users = [] ''' Json api 请求form里面Json 返回Json 好处: 1.通信的格式统一,对语言的约束就小了 2.易于做成open api 3.客户端重度渲染 RESTful api Dr. Fielding url 用资源来组织的 名词 /GET /players 拿到所有玩家 /GET /player/id 访问id的玩家的数据 /PUT /players 全量更新 ...
zh
0.587363
Json api 请求form里面Json 返回Json 好处: 1.通信的格式统一,对语言的约束就小了 2.易于做成open api 3.客户端重度渲染 RESTful api Dr. Fielding url 用资源来组织的 名词 /GET /players 拿到所有玩家 /GET /player/id 访问id的玩家的数据 /PUT /players 全量更新 /PATCH /players 部分更新 /DELETE /player/id 删除一个玩家 /GET /player/id/level <form method=post action='/add...
3.253951
3
cards/migrations/0012_auto_20180331_1348.py
mhndlsz/memodrop
18
5228
<reponame>mhndlsz/memodrop<filename>cards/migrations/0012_auto_20180331_1348.py # -*- coding: utf-8 -*- # Generated by Django 1.11.10 on 2018-03-31 13:48 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('cards', '00...
# -*- coding: utf-8 -*- # Generated by Django 1.11.10 on 2018-03-31 13:48 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('cards', '0011_auto_20180319_1112'), ] operations = [ migrations.AlterField...
en
0.707082
# -*- coding: utf-8 -*- # Generated by Django 1.11.10 on 2018-03-31 13:48
1.571986
2
MoMMI/Modules/ss14_nudges.py
T6751/MoMMI
18
5229
import logging from typing import Match, Any, Dict import aiohttp from discord import Message from MoMMI import comm_event, command, MChannel, always_command logger = logging.getLogger(__name__) @comm_event("ss14") async def ss14_nudge(channel: MChannel, message: Any, meta: str) -> None: try: config: Dict...
import logging from typing import Match, Any, Dict import aiohttp from discord import Message from MoMMI import comm_event, command, MChannel, always_command logger = logging.getLogger(__name__) @comm_event("ss14") async def ss14_nudge(channel: MChannel, message: Any, meta: str) -> None: try: config: Dict...
none
1
2.265257
2
oxe-api/test/resource/company/test_get_company_taxonomy.py
CybersecurityLuxembourg/openxeco
0
5230
<reponame>CybersecurityLuxembourg/openxeco<gh_stars>0 from test.BaseCase import BaseCase class TestGetCompanyTaxonomy(BaseCase): @BaseCase.login def test_ok(self, token): self.db.insert({"id": 1, "name": "My Company"}, self.db.tables["Company"]) self.db.insert({"id": 2, "name": "My Company 2"...
from test.BaseCase import BaseCase class TestGetCompanyTaxonomy(BaseCase): @BaseCase.login def test_ok(self, token): self.db.insert({"id": 1, "name": "My Company"}, self.db.tables["Company"]) self.db.insert({"id": 2, "name": "My Company 2"}, self.db.tables["Company"]) self.db.insert({...
none
1
2.395565
2
spoon/models/groupmembership.py
mikeboers/Spoon
4
5231
<reponame>mikeboers/Spoon import sqlalchemy as sa from ..core import db class GroupMembership(db.Model): __tablename__ = 'group_memberships' __table_args__ = dict( autoload=True, extend_existing=True, ) user = db.relationship('Account', foreign_keys='GroupMembership.user_id'...
import sqlalchemy as sa from ..core import db class GroupMembership(db.Model): __tablename__ = 'group_memberships' __table_args__ = dict( autoload=True, extend_existing=True, ) user = db.relationship('Account', foreign_keys='GroupMembership.user_id', backref=db.backr...
none
1
2.648123
3
nonlinear/aorta/nonlinearCasesCreation_aorta.py
HaolinCMU/Soft_tissue_tracking
3
5232
<gh_stars>1-10 # -*- coding: utf-8 -*- """ Created on Fri Aug 25 13:08:16 2020 @author: haolinl """ import copy import os import time import numpy as np import random import scipy.io # For extracting data from .mat file class inputFileGenerator(object): """ Generate input file for Abaqus....
# -*- coding: utf-8 -*- """ Created on Fri Aug 25 13:08:16 2020 @author: haolinl """ import copy import os import time import numpy as np import random import scipy.io # For extracting data from .mat file class inputFileGenerator(object): """ Generate input file for Abaqus. Unit s...
en
0.657038
# -*- coding: utf-8 -*- Created on Fri Aug 25 13:08:16 2020 @author: haolinl # For extracting data from .mat file Generate input file for Abaqus. Unit system: Length: m Force: N Pressure: Pa Initialize parameters. Parameters: ---------- data_file_nam...
2.549612
3
data/cache/test/test_cache.py
dongboyan77/quay
1
5233
<reponame>dongboyan77/quay import pytest from mock import patch from data.cache import InMemoryDataModelCache, NoopDataModelCache, MemcachedModelCache from data.cache.cache_key import CacheKey class MockClient(object): def __init__(self, server, **kwargs): self.data = {} def get(self, key, default=...
import pytest from mock import patch from data.cache import InMemoryDataModelCache, NoopDataModelCache, MemcachedModelCache from data.cache.cache_key import CacheKey class MockClient(object): def __init__(self, server, **kwargs): self.data = {} def get(self, key, default=None): return self....
en
0.982087
# Perform two retrievals, and make sure both return. # Ensure not cached since it was `1234`. # Ensure cached.
2.309508
2
Packs/HealthCheck/Scripts/HealthCheckIncidentsCreatedMonthly/HealthCheckIncidentsCreatedMonthly.py
mazmat-panw/content
2
5234
<gh_stars>1-10 import demistomock as demisto # noqa: F401 from CommonServerPython import * # noqa: F401 ctx = demisto.context() dataFromCtx = ctx.get("widgets") if not dataFromCtx: incident = demisto.incidents()[0] accountName = incident.get('account') accountName = f"acc_{accountName}" if accountName !=...
import demistomock as demisto # noqa: F401 from CommonServerPython import * # noqa: F401 ctx = demisto.context() dataFromCtx = ctx.get("widgets") if not dataFromCtx: incident = demisto.incidents()[0] accountName = incident.get('account') accountName = f"acc_{accountName}" if accountName != "" else "" ...
en
0.592941
# noqa: F401 # noqa: F401 # Line graph: # Bar graph:
2.046743
2
Bert_training.py
qzlydao/Bert_Sentiment_Analysis
0
5235
from torch.utils.data import DataLoader from dataset.wiki_dataset import BERTDataset from models.bert_model import * from tqdm import tqdm import numpy as np import pandas as pd import os config = {} config['train_corpus_path'] = './corpus/train_wiki.txt' config['test_corpus_path'] = './corpus/test_wiki.txt' config[...
from torch.utils.data import DataLoader from dataset.wiki_dataset import BERTDataset from models.bert_model import * from tqdm import tqdm import numpy as np import pandas as pd import os config = {} config['train_corpus_path'] = './corpus/train_wiki.txt' config['test_corpus_path'] = './corpus/test_wiki.txt' config[...
zh
0.583604
# 词量, 注意这里实际字(词)汇量 = vocab_size - 20 # 因为前20个token用来做一些特殊功能,如padding等 # 限定单句最大长度 # 初始化超参数的配置 # 初始化bert模型 # 初始化训练数据集 # 初始化训练dataloader # 初始化测试数据集 # 初始化测试dataloader # 初始化positional_encoding [max_seq_len, hidden_size] # 拓展positional_encoding的维度为[1, max_seq_len, hidden_size] # 列举需要优化的参数并传入优化器 # dim=2i # dim=2i+1 # todo 归一化...
2.490659
2
python/triton/language/random.py
appliedml85/triton
1
5236
<filename>python/triton/language/random.py import triton import triton.language as tl # Notes # 1. triton doesn't support uint32, so we use int32 instead and benefit from the fact that two's complement operations are equivalent to uint operations. # 2. multiply_low_high is currently inefficient. # 3. Even though tech...
<filename>python/triton/language/random.py import triton import triton.language as tl # Notes # 1. triton doesn't support uint32, so we use int32 instead and benefit from the fact that two's complement operations are equivalent to uint operations. # 2. multiply_low_high is currently inefficient. # 3. Even though tech...
en
0.765338
# Notes # 1. triton doesn't support uint32, so we use int32 instead and benefit from the fact that two's complement operations are equivalent to uint operations. # 2. multiply_low_high is currently inefficient. # 3. Even though technically philox sampling outputs int, in many places we pretends they were actualy uints ...
2.561285
3
pyctcdecode/__init__.py
kensho-technologies/pyctcdecode
203
5237
# Copyright 2021-present Kensho Technologies, LLC. from .alphabet import Alphabet # noqa from .decoder import BeamSearchDecoderCTC, build_ctcdecoder # noqa from .language_model import LanguageModel # noqa __package_name__ = "pyctcdecode" __version__ = "0.3.0"
# Copyright 2021-present Kensho Technologies, LLC. from .alphabet import Alphabet # noqa from .decoder import BeamSearchDecoderCTC, build_ctcdecoder # noqa from .language_model import LanguageModel # noqa __package_name__ = "pyctcdecode" __version__ = "0.3.0"
en
0.500194
# Copyright 2021-present Kensho Technologies, LLC. # noqa # noqa # noqa
0.975826
1
wumpus/start_server.py
marky1991/Legend-of-Wumpus
0
5238
<filename>wumpus/start_server.py from wumpus.server import Server from circuits import Debugger s = Server("0.0.0.0", 50551) + Debugger() s.run() import sys sys.exit(1)
<filename>wumpus/start_server.py from wumpus.server import Server from circuits import Debugger s = Server("0.0.0.0", 50551) + Debugger() s.run() import sys sys.exit(1)
none
1
1.815576
2
platypush/backend/joystick/linux/__init__.py
BlackLight/platypush
228
5239
import array import struct import time from fcntl import ioctl from typing import IO from platypush.backend import Backend from platypush.message.event.joystick import JoystickConnectedEvent, JoystickDisconnectedEvent, \ JoystickButtonPressedEvent, JoystickButtonReleasedEvent, JoystickAxisEvent class JoystickLin...
import array import struct import time from fcntl import ioctl from typing import IO from platypush.backend import Backend from platypush.message.event.joystick import JoystickConnectedEvent, JoystickDisconnectedEvent, \ JoystickButtonPressedEvent, JoystickButtonReleasedEvent, JoystickAxisEvent class JoystickLin...
en
0.683029
This backend intercepts events from joystick devices through the native Linux API implementation. It is loosely based on https://gist.github.com/rdb/8864666, which itself uses the `Linux kernel joystick API <https://www.kernel.org/doc/Documentation/input/joystick-api.txt>`_ to interact with the devices. ...
2.52181
3
src/modules/sensors/vehicle_magnetometer/mag_compensation/python/mag_compensation.py
SaxionMechatronics/Firmware
4,224
5240
<reponame>SaxionMechatronics/Firmware #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ File: mag_compensation.py Author: <NAME> Email: <EMAIL> Github: https://github.com/baumanta Description: Computes linear coefficients for mag compensation from thrust and current Usage: python mag_compensation.py /path/to/...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ File: mag_compensation.py Author: <NAME> Email: <EMAIL> Github: https://github.com/baumanta Description: Computes linear coefficients for mag compensation from thrust and current Usage: python mag_compensation.py /path/to/log/logfile.ulg current --instance 1 ...
en
0.740322
#!/usr/bin/env python3 # -*- coding: utf-8 -*- File: mag_compensation.py Author: <NAME> Email: <EMAIL> Github: https://github.com/baumanta Description: Computes linear coefficients for mag compensation from thrust and current Usage: python mag_compensation.py /path/to/log/logfile.ulg current --instance 1 Remar...
2.710739
3
app.py
19857625778/watchlist
0
5241
from flask import Flask app = Flask(_name_) @app.route('/') def hello(): return 'welcome to my watchlist'
from flask import Flask app = Flask(_name_) @app.route('/') def hello(): return 'welcome to my watchlist'
none
1
2.098747
2
portfolio_optimization/constants.py
AI-Traiding-Team/paired_trading
1
5242
<reponame>AI-Traiding-Team/paired_trading import os path1 = "outputs" path2 = "outputs/_imgs" path3 = "outputs/max_sharpe_weights" path4 = "outputs/opt_portfolio_trades" try: os.mkdir(path1) except OSError: print ("Директория %s уже создана" % path1) else: print ("Успешно создана директория %s " % path1) ...
import os path1 = "outputs" path2 = "outputs/_imgs" path3 = "outputs/max_sharpe_weights" path4 = "outputs/opt_portfolio_trades" try: os.mkdir(path1) except OSError: print ("Директория %s уже создана" % path1) else: print ("Успешно создана директория %s " % path1) try: os.makedirs(path2) os.makedi...
none
1
2.322614
2
mypy/transformtype.py
silky/mypy
1
5243
<filename>mypy/transformtype.py """Transform classes for runtime type checking.""" from typing import Undefined, List, Set, Any, cast, Tuple, Dict from mypy.nodes import ( TypeDef, Node, FuncDef, VarDef, Block, Var, ExpressionStmt, TypeInfo, SuperExpr, NameExpr, CallExpr, MDEF, MemberExpr, ReturnStmt, Ass...
<filename>mypy/transformtype.py """Transform classes for runtime type checking.""" from typing import Undefined, List, Set, Any, cast, Tuple, Dict from mypy.nodes import ( TypeDef, Node, FuncDef, VarDef, Block, Var, ExpressionStmt, TypeInfo, SuperExpr, NameExpr, CallExpr, MDEF, MemberExpr, ReturnStmt, Ass...
en
0.689189
Transform classes for runtime type checking. Class for transforming type definitions for runtime type checking. Transform a type definition by modifying it in-place. The following transformations are performed: * Represent generic type variables explicitly as attributes. * Create generic wrapper ...
2.43378
2
jazzpos/admin.py
AhmadManzoor/jazzpos
5
5244
from django.contrib import admin from django.contrib.auth.admin import UserAdmin from django.contrib.auth.models import User from django_tablib.admin import TablibAdmin from jazzpos.models import Customer, Patient, Store, CustomerType, StoreSettings from jazzpos.models import UserProfile class CustomerAdmin(TablibAd...
from django.contrib import admin from django.contrib.auth.admin import UserAdmin from django.contrib.auth.models import User from django_tablib.admin import TablibAdmin from jazzpos.models import Customer, Patient, Store, CustomerType, StoreSettings from jazzpos.models import UserProfile class CustomerAdmin(TablibAd...
none
1
1.863183
2
classification/imaterialist_challenge_furniture_2018/configs/train/train_inceptionresnetv2_350_ssd_like_v3.py
vfdev-5/ignite-examples
11
5245
# Basic training configuration file from torch.optim import RMSprop from torch.optim.lr_scheduler import MultiStepLR from torchvision.transforms import RandomHorizontalFlip, Compose from torchvision.transforms import RandomResizedCrop, RandomAffine, RandomApply from torchvision.transforms import ColorJitter, ToTensor, ...
# Basic training configuration file from torch.optim import RMSprop from torch.optim.lr_scheduler import MultiStepLR from torchvision.transforms import RandomHorizontalFlip, Compose from torchvision.transforms import RandomResizedCrop, RandomAffine, RandomApply from torchvision.transforms import ColorJitter, ToTensor, ...
en
0.690907
# Basic training configuration file # 'score_function': None
2.054018
2
examples/qmmm/02-mcscf.py
QuESt-Calculator/pyscf
501
5246
#!/usr/bin/env python # # Author: <NAME> <<EMAIL>> # ''' A simple example to run MCSCF with background charges. ''' import numpy from pyscf import gto, scf, mcscf, qmmm mol = gto.M(atom=''' C 1.1879 -0.3829 0.0000 C 0.0000 0.5526 0.0000 O -1.1867 -0.2472 0.0000 H -1.9237 0.3850 0.0000 H ...
#!/usr/bin/env python # # Author: <NAME> <<EMAIL>> # ''' A simple example to run MCSCF with background charges. ''' import numpy from pyscf import gto, scf, mcscf, qmmm mol = gto.M(atom=''' C 1.1879 -0.3829 0.0000 C 0.0000 0.5526 0.0000 O -1.1867 -0.2472 0.0000 H -1.9237 0.3850 0.0000 H ...
en
0.66671
#!/usr/bin/env python # # Author: <NAME> <<EMAIL>> # A simple example to run MCSCF with background charges. C 1.1879 -0.3829 0.0000 C 0.0000 0.5526 0.0000 O -1.1867 -0.2472 0.0000 H -1.9237 0.3850 0.0000 H 2.0985 0.2306 0.0000 H 1.1184 -1.0093 0.8869 H 1.1184 -1.0093 -0...
2.545545
3
mtp_send_money/apps/send_money/utils.py
uk-gov-mirror/ministryofjustice.money-to-prisoners-send-money
0
5247
import datetime from decimal import Decimal, ROUND_DOWN, ROUND_UP import logging import re from django.conf import settings from django.core.exceptions import ValidationError from django.core.validators import RegexValidator from django.utils import formats from django.utils.cache import patch_cache_control from djang...
import datetime from decimal import Decimal, ROUND_DOWN, ROUND_UP import logging import re from django.conf import settings from django.core.exceptions import ValidationError from django.core.validators import RegexValidator from django.utils import formats from django.utils.cache import patch_cache_control from djang...
en
0.750541
# service is deemed unavailable only if status is explicitly false, not if it cannot be determined Formats a number into currency format @param amount: amount in pounds @param trim_empty_pence: if True, strip off .00 Formats a number into currency format display pence only as #p @param amount: amount in pou...
2.19158
2
src/zmbrelev/config.py
Zumbi-ML/zmbRELEV
0
5248
# -*- coding: UTF-8 -*- import os this_file_path = os.path.dirname(os.path.realpath(__file__)) MODELS_DIR = os.path.join(this_file_path, "models/")
# -*- coding: UTF-8 -*- import os this_file_path = os.path.dirname(os.path.realpath(__file__)) MODELS_DIR = os.path.join(this_file_path, "models/")
en
0.222803
# -*- coding: UTF-8 -*-
1.60481
2
ArraysP2.py
EdgarVallejo96/pyEdureka
0
5249
<reponame>EdgarVallejo96/pyEdureka<filename>ArraysP2.py import array as arr a = arr.array('i', [ 1,2,3,4,5,6]) print(a) # Accessing elements print(a[2]) print(a[-2]) # BASIC ARRAY OPERATIONS # Find length of array print() print('Length of array') print(len(a)) # Adding elments to an array # append() to add a single ...
import array as arr a = arr.array('i', [ 1,2,3,4,5,6]) print(a) # Accessing elements print(a[2]) print(a[-2]) # BASIC ARRAY OPERATIONS # Find length of array print() print('Length of array') print(len(a)) # Adding elments to an array # append() to add a single element at the end of an array # extend() to add more th...
en
0.758268
# Accessing elements # BASIC ARRAY OPERATIONS # Find length of array # Adding elments to an array # append() to add a single element at the end of an array # extend() to add more than one element at the end of an array # insert() to add an element at a specific position in an array # append # extend # insert # first pa...
4.263579
4
vesper/mpg_ranch/nfc_detector_low_score_classifier_1_0/classifier.py
RichardLitt/Vesper
29
5250
<reponame>RichardLitt/Vesper<filename>vesper/mpg_ranch/nfc_detector_low_score_classifier_1_0/classifier.py """ Module containing low score classifier for MPG Ranch NFC detectors. An instance of the `Classifier` class of this module assigns the `LowScore` classification to a clip if the clip has no `Classification` ann...
""" Module containing low score classifier for MPG Ranch NFC detectors. An instance of the `Classifier` class of this module assigns the `LowScore` classification to a clip if the clip has no `Classification` annotation and has a `DetectorScore` annotation whose value is less than a threshold. This classifier is inte...
en
0.782032
Module containing low score classifier for MPG Ranch NFC detectors. An instance of the `Classifier` class of this module assigns the `LowScore` classification to a clip if the clip has no `Classification` annotation and has a `DetectorScore` annotation whose value is less than a threshold. This classifier is intended...
2.485893
2
setup.py
yitzikc/athena2pd
1
5251
<filename>setup.py from setuptools import setup, find_packages def find_version(path): import re # path shall be a plain ascii tetxt file s = open(path, 'rt').read() version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", s, re.M) if version_match: return version_match.group(1) ...
<filename>setup.py from setuptools import setup, find_packages def find_version(path): import re # path shall be a plain ascii tetxt file s = open(path, 'rt').read() version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", s, re.M) if version_match: return version_match.group(1) ...
en
0.591881
# path shall be a plain ascii tetxt file
2.12787
2
mmdet/core/ufp/__init__.py
PuAnysh/UFPMP-Det
9
5252
<reponame>PuAnysh/UFPMP-Det from .spp import * from .unified_foreground_packing import * __all__ = [ 'phsppog', 'UnifiedForegroundPacking' ]
from .spp import * from .unified_foreground_packing import * __all__ = [ 'phsppog', 'UnifiedForegroundPacking' ]
none
1
1.147174
1
PythonBasics/ExamPreparation/FamilyTrip.py
achoraev/SoftUni
0
5253
budget = float(input()) nights = int(input()) price_night = float(input()) percent_extra = int(input()) if nights > 7: price_night = price_night - (price_night * 0.05) sum = nights * price_night total_sum = sum + (budget * percent_extra / 100) if total_sum <= budget: print(f"Ivanovi will be left ...
budget = float(input()) nights = int(input()) price_night = float(input()) percent_extra = int(input()) if nights > 7: price_night = price_night - (price_night * 0.05) sum = nights * price_night total_sum = sum + (budget * percent_extra / 100) if total_sum <= budget: print(f"Ivanovi will be left ...
none
1
3.698799
4
tex_live_package_manager/progress.py
csch0/SublimeText-TeX-Live-Package-Manager
2
5254
<reponame>csch0/SublimeText-TeX-Live-Package-Manager import sublime, sublime_plugin import threading class ProcessQueueManager(): __shared = {} items = [] thread = None # Current item details messages = None function = None callback = None # Progress Bar preferences i = 0 size = 8 add = 1 def __new__...
import sublime, sublime_plugin import threading class ProcessQueueManager(): __shared = {} items = [] thread = None # Current item details messages = None function = None callback = None # Progress Bar preferences i = 0 size = 8 add = 1 def __new__(cls, *args, **kwargs): inst = object.__new__(cls) ...
en
0.52435
# Current item details # Progress Bar preferences # If thread available and running # Recall run # Stop if thread available, not running and no item is available # Callback # Reset progress details # If no thread availale or not running # Check for callback of old item # Queue available # Start thread for current item ...
2.711245
3
moscow_routes_parser/t_mos_ru.py
rscprof/moscow_routes_parser
0
5255
<filename>moscow_routes_parser/t_mos_ru.py import html import json import logging import re from abc import abstractmethod from datetime import datetime, time from typing import Optional import requests from moscow_routes_parser.model import Route, Timetable, Equipment, Timetable_builder from moscow_routes_parser.mod...
<filename>moscow_routes_parser/t_mos_ru.py import html import json import logging import re from abc import abstractmethod from datetime import datetime, time from typing import Optional import requests from moscow_routes_parser.model import Route, Timetable, Equipment, Timetable_builder from moscow_routes_parser.mod...
en
0.51775
"Interface for parser "Parser for timetable from t.mos.ru implementation "Initialize parser :param builder: Builder for Timetable for route Parse text from https://transport.mos.ru/ru/ajax/App/ScheduleController/getRoute (for format using 2022-Jan-11) Since 12.01.2022 t.mos.ru drop data-service...
3.059952
3
web/api/get_summary_data.py
spudmind/spud
2
5256
from web.api import BaseAPI from utils import mongo import json class DataApi(BaseAPI): def __init__(self): BaseAPI.__init__(self) self._db = mongo.MongoInterface() self.query = {} self.fields = { "donation_count": "$influences.electoral_commission.donation_count", ...
from web.api import BaseAPI from utils import mongo import json class DataApi(BaseAPI): def __init__(self): BaseAPI.__init__(self) self._db = mongo.MongoInterface() self.query = {} self.fields = { "donation_count": "$influences.electoral_commission.donation_count", ...
en
0.706962
#"lobby_agencies": self._influencers_aggregate(), # get electoral commission data # get register of interests data # get electoral commission data # get register of interests data # get electoral commission data # get register of interests data
2.365273
2
neutron/common/ovn/utils.py
guillermomolina/neutron
3
5257
# 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 # d...
# 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 # d...
en
0.798515
# 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 # d...
1.385207
1
ens/exceptions.py
pjryan93/web3.py
326
5258
import idna class AddressMismatch(ValueError): ''' In order to set up reverse resolution correctly, the ENS name should first point to the address. This exception is raised if the name does not currently point to the address. ''' pass class InvalidName(idna.IDNAError): ''' This excep...
import idna class AddressMismatch(ValueError): ''' In order to set up reverse resolution correctly, the ENS name should first point to the address. This exception is raised if the name does not currently point to the address. ''' pass class InvalidName(idna.IDNAError): ''' This excep...
en
0.905502
In order to set up reverse resolution correctly, the ENS name should first point to the address. This exception is raised if the name does not currently point to the address. This exception is raised if the provided name does not meet the syntax standards specified in `EIP 137 name syntax <https://githu...
2.977406
3
Submods/MAS Additions/MASM/scripts/midi_input.py
CaptainHorse/MAS-Additions
13
5259
<filename>Submods/MAS Additions/MASM/scripts/midi_input.py import mido from socketer import MASM inPort = None doReadInput = False def Start(): global inPort try: print(f"MIDI inputs: {mido.get_input_names()}") inPort = mido.open_input() print(f"MIDI input open: {inPort}") except Exception as e: inPort = N...
<filename>Submods/MAS Additions/MASM/scripts/midi_input.py import mido from socketer import MASM inPort = None doReadInput = False def Start(): global inPort try: print(f"MIDI inputs: {mido.get_input_names()}") inPort = mido.open_input() print(f"MIDI input open: {inPort}") except Exception as e: inPort = N...
en
0.887704
# We want to clear old pending messages but not send them if input is disabled
2.401638
2
dash_carbon_components/Column.py
Matheus-Rangel/dash-carbon-components
4
5260
<reponame>Matheus-Rangel/dash-carbon-components # AUTO GENERATED FILE - DO NOT EDIT from dash.development.base_component import Component, _explicitize_args class Column(Component): """A Column component. Row Column Keyword arguments: - children (list of a list of or a singular dash component, string or numbers...
# AUTO GENERATED FILE - DO NOT EDIT from dash.development.base_component import Component, _explicitize_args class Column(Component): """A Column component. Row Column Keyword arguments: - children (list of a list of or a singular dash component, string or numbers | a list of or a singular dash component, strin...
en
0.61851
# AUTO GENERATED FILE - DO NOT EDIT A Column component. Row Column Keyword arguments: - children (list of a list of or a singular dash component, string or numbers | a list of or a singular dash component, string or number; optional): The children of the element - style (dict; optional): The inline styles - id (string...
2.361208
2
src/backend/schemas/vps.py
ddddhm1/LuWu
658
5261
from typing import List from typing import Optional from typing import Union from models.vps import VpsStatus from schemas.base import APIModel from schemas.base import BasePagination from schemas.base import BaseSchema from schemas.base import BaseSuccessfulResponseModel class VpsSshKeySchema(APIModel): name: s...
from typing import List from typing import Optional from typing import Union from models.vps import VpsStatus from schemas.base import APIModel from schemas.base import BasePagination from schemas.base import BaseSchema from schemas.base import BaseSuccessfulResponseModel class VpsSshKeySchema(APIModel): name: s...
none
1
2.205259
2
main.py
hari-sh/sigplot
0
5262
<filename>main.py import sigplot as sp import matplotlib import matplotlib.pyplot as plt import numpy as np matplotlib.rcParams['toolbar'] = 'None' plt.style.use('dark_background') fig = plt.figure() # seed = np.linspace(3, 7, 1000) # a = (np.sin(2 * np.pi * seed)) # b = (np.cos(2 * np.pi * seed)) # s...
<filename>main.py import sigplot as sp import matplotlib import matplotlib.pyplot as plt import numpy as np matplotlib.rcParams['toolbar'] = 'None' plt.style.use('dark_background') fig = plt.figure() # seed = np.linspace(3, 7, 1000) # a = (np.sin(2 * np.pi * seed)) # b = (np.cos(2 * np.pi * seed)) # s...
en
0.367299
# seed = np.linspace(3, 7, 1000) # a = (np.sin(2 * np.pi * seed)) # b = (np.cos(2 * np.pi * seed)) # sp.correlate(fig, b, a, 300) # x = np.concatenate([np.zeros(500), signal.sawtooth(2 * np.pi * 5 * t), np.zeros(500), np.ones(120), np.zeros(500)]) # WriteToVideo("twoPulse.mp4", anim);
2.440386
2
test/vanilla/version-tolerant/Expected/AcceptanceTests/UrlVersionTolerant/urlversiontolerant/operations/_operations.py
msyyc/autorest.python
0
5263
<filename>test/vanilla/version-tolerant/Expected/AcceptanceTests/UrlVersionTolerant/urlversiontolerant/operations/_operations.py<gh_stars>0 # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT Lic...
<filename>test/vanilla/version-tolerant/Expected/AcceptanceTests/UrlVersionTolerant/urlversiontolerant/operations/_operations.py<gh_stars>0 # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT Lic...
en
0.343436
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
1.765573
2
baseplate_py_upgrader/docker.py
reddit/baseplate.py-upgrader
6
5264
<reponame>reddit/baseplate.py-upgrader import logging import re from pathlib import Path from typing import Match logger = logging.getLogger(__name__) IMAGE_RE = re.compile( r"/baseplate-py:(?P<version>[0-9.]+(\.[0-9]+)?)-py(?P<python>[23]\.[0-9]+)-(?P<distro>(bionic|buster))(?P<repo>-artifactory)?(?P<dev>-dev...
import logging import re from pathlib import Path from typing import Match logger = logging.getLogger(__name__) IMAGE_RE = re.compile( r"/baseplate-py:(?P<version>[0-9.]+(\.[0-9]+)?)-py(?P<python>[23]\.[0-9]+)-(?P<distro>(bionic|buster))(?P<repo>-artifactory)?(?P<dev>-dev)?" ) def upgrade_docker_image_refere...
none
1
2.489152
2
model/swtz_ty.py
ArcherLuo233/election-s-prediction
0
5265
<reponame>ArcherLuo233/election-s-prediction from sqlalchemy import Column, ForeignKey, Integer, String, Text from model.base import Base class SWTZ_TY(Base): __tablename__ = 'swtz_ty' class_name = '商务团组-团员' foreign_key = 'swtz_id' export_docx = False export_handle_file = ['identity'] field ...
from sqlalchemy import Column, ForeignKey, Integer, String, Text from model.base import Base class SWTZ_TY(Base): __tablename__ = 'swtz_ty' class_name = '商务团组-团员' foreign_key = 'swtz_id' export_docx = False export_handle_file = ['identity'] field = [ 'id', 'nickname', 'job', 'id_card...
none
1
2.309963
2
amy/dashboard/tests/test_autoupdate_profile.py
code-review-doctor/amy
53
5266
from django.urls import reverse from consents.models import Consent, Term from workshops.models import KnowledgeDomain, Person, Qualification from workshops.tests.base import TestBase class TestAutoUpdateProfile(TestBase): def setUp(self): self._setUpAirports() self._setUpLessons() self._...
from django.urls import reverse from consents.models import Consent, Term from workshops.models import KnowledgeDomain, Person, Qualification from workshops.tests.base import TestBase class TestAutoUpdateProfile(TestBase): def setUp(self): self._setUpAirports() self._setUpLessons() self._...
en
0.888832
# username is read-only # github is read-only
2.187256
2
bot/recognizer_bot/yolo/common/utils.py
kprokofi/animal-recognition-with-voice
1
5267
import numpy as np import time import cv2 import colorsys import tensorflow as tf from tensorflow.keras import backend as K from tensorflow.keras.layers import Activation, ReLU, Multiply # Custom objects from backbones package https://github.com/david8862/keras-YOLOv3-model-set/tree/master/common/backbones def mish(...
import numpy as np import time import cv2 import colorsys import tensorflow as tf from tensorflow.keras import backend as K from tensorflow.keras.layers import Activation, ReLU, Multiply # Custom objects from backbones package https://github.com/david8862/keras-YOLOv3-model-set/tree/master/common/backbones def mish(...
en
0.677058
# Custom objects from backbones package https://github.com/david8862/keras-YOLOv3-model-set/tree/master/common/backbones Swish activation function. # Arguments x: Input tensor. # Returns The Swish activation: `x * sigmoid(x)`. # References [Searching for Activation Functions](https:/...
2.850225
3
ros/src/tl_detector/light_classification/tl_classifier.py
PhilippHafe/CarND-Capstone
0
5268
<reponame>PhilippHafe/CarND-Capstone from styx_msgs.msg import TrafficLight import tensorflow as tf import numpy as np import datetime class TLClassifier(object): def __init__(self): PATH_TO_CKPT = "light_classification/frozen_inference_graph.pb" self.graph = tf.Graph() self.threshold = 0.5...
from styx_msgs.msg import TrafficLight import tensorflow as tf import numpy as np import datetime class TLClassifier(object): def __init__(self): PATH_TO_CKPT = "light_classification/frozen_inference_graph.pb" self.graph = tf.Graph() self.threshold = 0.5 with self.graph.as_default(...
en
0.648481
Determines the color of the traffic light in the image Args: image (cv::Mat): image containing the traffic light Returns: int: ID of traffic light color (specified in styx_msgs/TrafficLight) #TODO implement light color prediction #print(dur.total_seconds())
2.551978
3
testGMDS.py
ctralie/SiRPyGL
7
5269
#Based off of http://wiki.wxpython.org/GLCanvas #Lots of help from http://wiki.wxpython.org/Getting%20Started from OpenGL.GL import * import wx from wx import glcanvas from Primitives3D import * from PolyMesh import * from LaplacianMesh import * from Geodesics import * from PointCloud import * from Cameras3D import * ...
#Based off of http://wiki.wxpython.org/GLCanvas #Lots of help from http://wiki.wxpython.org/Getting%20Started from OpenGL.GL import * import wx from wx import glcanvas from Primitives3D import * from PolyMesh import * from LaplacianMesh import * from Geodesics import * from PointCloud import * from Cameras3D import * ...
en
0.801374
#Based off of http://wiki.wxpython.org/GLCanvas #Lots of help from http://wiki.wxpython.org/Getting%20Started #from sklearn import manifold #Camera state variables #self.camera = MouseSphericalCamera(self.size.x, self.size.y) #Main state variables #Face mesh variables and manipulation variables #Holds the transformatio...
2.073151
2
PySS/fem.py
manpan-1/PySS
2
5270
import matplotlib.pyplot as plt import numpy as np import pickle # import csv # from collections import namedtuple # from mpl_toolkits.mplot3d import Axes3D # import matplotlib.animation as animation # import matplotlib.colors as mc class FEModel: def __init__(self, name=None, hist_data=None): self.name =...
import matplotlib.pyplot as plt import numpy as np import pickle # import csv # from collections import namedtuple # from mpl_toolkits.mplot3d import Axes3D # import matplotlib.animation as animation # import matplotlib.colors as mc class FEModel: def __init__(self, name=None, hist_data=None): self.name =...
en
0.37674
# import csv # from collections import namedtuple # from mpl_toolkits.mplot3d import Axes3D # import matplotlib.animation as animation # import matplotlib.colors as mc Used to convert the load-displacement data exported from models to a dictionary XXXXXXXXXXXXXXXXXXXXXXXXXX Creates an object and imports history output ...
2.856158
3
gigamonkeys/get.py
gigamonkey/sheets
0
5271
#!/usr/bin/env python import json import sys from gigamonkeys.spreadsheets import spreadsheets spreadsheet_id = sys.argv[1] ranges = sys.argv[2:] data = spreadsheets().get(spreadsheet_id, include_grid_data=bool(ranges), ranges=ranges) json.dump(data, sys.stdout, indent=2)
#!/usr/bin/env python import json import sys from gigamonkeys.spreadsheets import spreadsheets spreadsheet_id = sys.argv[1] ranges = sys.argv[2:] data = spreadsheets().get(spreadsheet_id, include_grid_data=bool(ranges), ranges=ranges) json.dump(data, sys.stdout, indent=2)
ru
0.26433
#!/usr/bin/env python
2.202869
2
config.py
mhmddpkts/Get-Turkish-Words-with-Web-Scraping
0
5272
root_URL = "https://tr.wiktionary.org/wiki/Vikis%C3%B6zl%C3%BCk:S%C3%B6zc%C3%BCk_listesi_" filepath = "words.csv" #letters=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O", # "P","R","S","T","U","V","Y","Z"] ##İ,Ç,Ö,Ş,Ü harfleri not work correctly letters=["C"]
root_URL = "https://tr.wiktionary.org/wiki/Vikis%C3%B6zl%C3%BCk:S%C3%B6zc%C3%BCk_listesi_" filepath = "words.csv" #letters=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O", # "P","R","S","T","U","V","Y","Z"] ##İ,Ç,Ö,Ş,Ü harfleri not work correctly letters=["C"]
it
0.584449
#letters=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O", # "P","R","S","T","U","V","Y","Z"] ##İ,Ç,Ö,Ş,Ü harfleri not work correctly
2.148895
2
sow_generator/tasks.py
praekelt/sow-generator
1
5273
<filename>sow_generator/tasks.py from github3 import login from github3.models import GitHubError from celery import task from celery.decorators import periodic_task from celery.task.schedules import crontab from sow_generator.models import Repository, AuthToken def _sync_repository(obj): dirty = False token...
<filename>sow_generator/tasks.py from github3 import login from github3.models import GitHubError from celery import task from celery.decorators import periodic_task from celery.task.schedules import crontab from sow_generator.models import Repository, AuthToken def _sync_repository(obj): dirty = False token...
en
0.600379
# Find RST or MD files. Markdown takes precedence. Sync all repositories
2.283984
2
sources/wrappers.py
X-rayLaser/keras-auto-hwr
0
5274
import numpy as np from sources import BaseSource from sources.base import BaseSourceWrapper from sources.preloaded import PreLoadedSource import json class WordsSource(BaseSource): def __init__(self, source): self._source = source def __len__(self): return len(self._source) def _remove_...
import numpy as np from sources import BaseSource from sources.base import BaseSourceWrapper from sources.preloaded import PreLoadedSource import json class WordsSource(BaseSource): def __init__(self, source): self._source = source def __len__(self): return len(self._source) def _remove_...
en
0.828001
# we do not want to normalize END-OF-STROKE flag which is last in the tuple #print(j, seq_out)
2.517001
3
multiworld/multiworld/core/image_env.py
yufeiwang63/ROLL
11
5275
<reponame>yufeiwang63/ROLL import random import cv2 import numpy as np import warnings from PIL import Image from gym.spaces import Box, Dict from multiworld.core.multitask_env import MultitaskEnv from multiworld.core.wrapper_env import ProxyEnv from multiworld.envs.env_util import concatenate_box_spaces from multiwo...
import random import cv2 import numpy as np import warnings from PIL import Image from gym.spaces import Box, Dict from multiworld.core.multitask_env import MultitaskEnv from multiworld.core.wrapper_env import ProxyEnv from multiworld.envs.env_util import concatenate_box_spaces from multiworld.envs.env_util import ge...
en
0.850396
:param wrapped_env: :param imsize: :param init_camera: :param transpose: :param grayscale: :param normalize: :param reward_type: :param threshold: :param image_length: :param presampled_goals: :param non_presampled_goal_img_is_garbage: Set ...
2.171317
2
sample_full_post_processor.py
huynguyen82/Modified-Kaldi-GStream-OnlineServer
0
5276
#!/usr/bin/env python import sys import json import logging from math import exp import requests as rq import re ### For NLP post-processing header={"Content-Type": "application/json"} message='{"sample":"Hello bigdata"}' api_url="http://192.168.1.197:11992/norm" ### def NLP_process_output(pre_str): try: ...
#!/usr/bin/env python import sys import json import logging from math import exp import requests as rq import re ### For NLP post-processing header={"Content-Type": "application/json"} message='{"sample":"Hello bigdata"}' api_url="http://192.168.1.197:11992/norm" ### def NLP_process_output(pre_str): try: ...
en
0.2437
#!/usr/bin/env python ### For NLP post-processing ### # EOF
2.681273
3
lang_detect_gears.py
AlexMikhalev/cord19redisknowledgegraph
7
5277
<reponame>AlexMikhalev/cord19redisknowledgegraph<gh_stars>1-10 from langdetect import detect def detect_language(x): #detect language of the article try: lang=detect(x['value']) except: lang="empty" execute('SET', 'lang_article:' + x['key'], lang) if lang!='en': execute('...
from langdetect import detect def detect_language(x): #detect language of the article try: lang=detect(x['value']) except: lang="empty" execute('SET', 'lang_article:' + x['key'], lang) if lang!='en': execute('SADD','titles_to_delete', x['key']) gb = GB() gb.foreach(detec...
en
0.798828
#detect language of the article
2.722049
3
daemon/core/coreobj.py
shanv82/core
0
5278
""" Defines the basic objects for CORE emulation: the PyCoreObj base class, along with PyCoreNode, PyCoreNet, and PyCoreNetIf. """ import os import shutil import socket import threading from socket import AF_INET from socket import AF_INET6 from core.data import NodeData, LinkData from core.enumerations import LinkTy...
""" Defines the basic objects for CORE emulation: the PyCoreObj base class, along with PyCoreNode, PyCoreNet, and PyCoreNetIf. """ import os import shutil import socket import threading from socket import AF_INET from socket import AF_INET6 from core.data import NodeData, LinkData from core.enumerations import LinkTy...
en
0.602278
Defines the basic objects for CORE emulation: the PyCoreObj base class, along with PyCoreNode, PyCoreNet, and PyCoreNetIf. Helper class for Cartesian coordinate position Creates a Position instance. :param x: x position :param y: y position :param z: z position :return: Returns True if ...
2.850549
3
abc/128/b.py
wotsushi/competitive-programming
3
5279
# 入力 N = int(input()) S, P = ( zip(*( (s, int(p)) for s, p in (input().split() for _ in range(N)) )) if N else ((), ()) ) ans = '\n'.join( str(i) for _, _, i in sorted( zip( S, P, range(1, N + 1) ), key=lambda t: (t[0], -t[...
# 入力 N = int(input()) S, P = ( zip(*( (s, int(p)) for s, p in (input().split() for _ in range(N)) )) if N else ((), ()) ) ans = '\n'.join( str(i) for _, _, i in sorted( zip( S, P, range(1, N + 1) ), key=lambda t: (t[0], -t[...
none
1
3.02441
3
additional/hashcat_crack.py
mmmds/WirelessDiscoverCrackScan
2
5280
# External cracking script, part of https://github.com/mmmds/WirelessDiscoverCrackScan import datetime import subprocess import os ### CONFIGURATION HASHCAT_DIR = "C:\\hashcat-5.1.0" HASHCAT_EXE = "hashcat64.exe" LOG_FILE = "crack_log.txt" DICT_DIR = "./dicts" def load_dict_list(): for r,d,f in os.walk(DICT_DIR)...
# External cracking script, part of https://github.com/mmmds/WirelessDiscoverCrackScan import datetime import subprocess import os ### CONFIGURATION HASHCAT_DIR = "C:\\hashcat-5.1.0" HASHCAT_EXE = "hashcat64.exe" LOG_FILE = "crack_log.txt" DICT_DIR = "./dicts" def load_dict_list(): for r,d,f in os.walk(DICT_DIR)...
en
0.428005
# External cracking script, part of https://github.com/mmmds/WirelessDiscoverCrackScan ### CONFIGURATION ######## {} {}\n\n".format(f, d))
2.448722
2
editortools/player.py
bennettdc/MCEdit-Unified
237
5281
"""Copyright (c) 2010-2012 <NAME> Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES W...
"""Copyright (c) 2010-2012 <NAME> Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES W...
en
0.582596
Copyright (c) 2010-2012 <NAME> Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH...
1.466852
1
seismic/checkpointing/checkpoint.py
slimgroup/Devito-Examples
7
5282
# The MIT License (MIT) # # Copyright (c) 2016, Imperial College, London # # Permission is hereby granted, free of charge, to any person obtaining a copy of # this software and associated documentation files (the "Software"), to deal in the # Software without restriction, including without limitation the rights t...
# The MIT License (MIT) # # Copyright (c) 2016, Imperial College, London # # Permission is hereby granted, free of charge, to any person obtaining a copy of # this software and associated documentation files (the "Software"), to deal in the # Software without restriction, including without limitation the rights t...
en
0.749902
# The MIT License (MIT) # # Copyright (c) 2016, Imperial College, London # # Permission is hereby granted, free of charge, to any person obtaining a copy of # this software and associated documentation files (the "Software"), to deal in the # Software without restriction, including without limitation the rights to use,...
1.92698
2
lbrynet/file_manager/EncryptedFileManager.py
shyba/lbry
1
5283
""" Keep track of which LBRY Files are downloading and store their LBRY File specific metadata """ import logging import os from twisted.enterprise import adbapi from twisted.internet import defer, task, reactor from twisted.python.failure import Failure from lbrynet.reflector.reupload import reflect_stream from lbr...
""" Keep track of which LBRY Files are downloading and store their LBRY File specific metadata """ import logging import os from twisted.enterprise import adbapi from twisted.internet import defer, task, reactor from twisted.python.failure import Failure from lbrynet.reflector.reupload import reflect_stream from lbr...
en
0.932124
Keep track of which LBRY Files are downloading and store their LBRY File specific metadata Keeps track of currently opened LBRY Files, their options, and their LBRY File specific metadata. # TODO: why is sd_identifier part of the file manager? # check that all the streams in the stream_info_manager are also # track...
2.147663
2
Perforce/AppUtils.py
TomMinor/MayaPerforce
13
5284
<filename>Perforce/AppUtils.py import os import sys import re import logging p4_logger = logging.getLogger("Perforce") # Import app specific utilities, maya opens scenes differently than nuke etc # Are we in maya or nuke? if re.match( "maya", os.path.basename( sys.executable ), re.I ): p4_logger.info("Conf...
<filename>Perforce/AppUtils.py import os import sys import re import logging p4_logger = logging.getLogger("Perforce") # Import app specific utilities, maya opens scenes differently than nuke etc # Are we in maya or nuke? if re.match( "maya", os.path.basename( sys.executable ), re.I ): p4_logger.info("Conf...
en
0.894646
# Import app specific utilities, maya opens scenes differently than nuke etc # Are we in maya or nuke?
2.089407
2
fhir/immunizations_demo/models/trainer/model.py
kourtneyshort/healthcare
0
5285
<reponame>kourtneyshort/healthcare #!/usr/bin/python3 # # Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unl...
#!/usr/bin/python3 # # Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
en
0.85143
#!/usr/bin/python3 # # Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
2.139662
2
heliosburn/django/hbproject/webui/models.py
thecodeteam/heliosburn
0
5286
<gh_stars>0 import json import re from django.conf import settings import requests from webui.exceptions import BadRequestException, UnauthorizedException, ServerErrorException, RedirectException, \ UnexpectedException, LocationHeaderNotFoundException, NotFoundException def validate_response(response): if 200...
import json import re from django.conf import settings import requests from webui.exceptions import BadRequestException, UnauthorizedException, ServerErrorException, RedirectException, \ UnexpectedException, LocationHeaderNotFoundException, NotFoundException def validate_response(response): if 200 <= response...
none
1
2.245102
2
src/ychaos/core/verification/controller.py
sushilkar/ychaos
0
5287
# Copyright 2021, Yahoo # Licensed under the terms of the Apache 2.0 license. See the LICENSE file in the project root for terms import time from typing import Dict, List, Optional, Type from pydantic import validate_arguments from ...app_logger import AppLogger from ...testplan import SystemState from ...testplan....
# Copyright 2021, Yahoo # Licensed under the terms of the Apache 2.0 license. See the LICENSE file in the project root for terms import time from typing import Dict, List, Optional, Type from pydantic import validate_arguments from ...app_logger import AppLogger from ...testplan import SystemState from ...testplan....
en
0.863602
# Copyright 2021, Yahoo # Licensed under the terms of the Apache 2.0 license. See the LICENSE file in the project root for terms # Enum value to corresponding Plugin Map Verification controller is used to run all the verification plugins configured in the testplan and assert that the system is expected to be in a...
2.327209
2
tests/test_vimeodl.py
binary-signal/vimeo-channel-downloader
6
5288
#!/usr/bin/env python # -*- coding: utf-8 -*- from vimeodl import __version__ from vimeodl.vimeo import VimeoLinkExtractor, VimeoDownloader def test_version(): assert __version__ == '0.1.0' def test_vimeo_link_extractor(): vm = VimeoLinkExtractor() vm.extract()
#!/usr/bin/env python # -*- coding: utf-8 -*- from vimeodl import __version__ from vimeodl.vimeo import VimeoLinkExtractor, VimeoDownloader def test_version(): assert __version__ == '0.1.0' def test_vimeo_link_extractor(): vm = VimeoLinkExtractor() vm.extract()
en
0.352855
#!/usr/bin/env python # -*- coding: utf-8 -*-
2.117192
2
labgraph/graphs/node_test_harness.py
Yunusbcr/labgraph
124
5289
<gh_stars>100-1000 #!/usr/bin/env python3 # Copyright 2004-present Facebook. All Rights Reserved. import asyncio import functools import inspect from contextlib import contextmanager from typing import ( Any, AsyncIterable, Awaitable, Callable, Generic, Iterator, List, Mapping, Opti...
#!/usr/bin/env python3 # Copyright 2004-present Facebook. All Rights Reserved. import asyncio import functools import inspect from contextlib import contextmanager from typing import ( Any, AsyncIterable, Awaitable, Callable, Generic, Iterator, List, Mapping, Optional, Sequence,...
en
0.752918
#!/usr/bin/env python3 # Copyright 2004-present Facebook. All Rights Reserved. # Node type # Type yielded by async functions Utility class for testing Labgraph nodes. This allows a user to test some behavior of a node in an asyncio event loop, with the harness taking care of setting up and cleaning up the node....
2.386549
2
pygamelearning/lrud.py
edward70/2021Computing
0
5290
<filename>pygamelearning/lrud.py import pygame import sys pygame.init() clock = pygame.time.Clock() screen = pygame.display.set_mode([500, 500]) gameOn = True x1 = 0 y1 = 100 x2 = 100 y2 = 0 while gameOn == True: screen.fill([255,255,255]) for event in pygame.event.get(): if event.type == pygame.QUIT...
<filename>pygamelearning/lrud.py import pygame import sys pygame.init() clock = pygame.time.Clock() screen = pygame.display.set_mode([500, 500]) gameOn = True x1 = 0 y1 = 100 x2 = 100 y2 = 0 while gameOn == True: screen.fill([255,255,255]) for event in pygame.event.get(): if event.type == pygame.QUIT...
none
1
3.702244
4
pytorch/xor/training_a_perceptron.py
e93fem/PyTorchNLPBook
0
5291
import numpy as np import torch import matplotlib.pyplot as plt from torch import optim, nn from pytorch.xor.multilayer_perceptron import MultilayerPerceptron from pytorch.xor.utils import LABELS, get_toy_data, visualize_results, plot_intermediate_representations input_size = 2 output_size = len(set(LABELS)) num_hidd...
import numpy as np import torch import matplotlib.pyplot as plt from torch import optim, nn from pytorch.xor.multilayer_perceptron import MultilayerPerceptron from pytorch.xor.utils import LABELS, get_toy_data, visualize_results, plot_intermediate_representations input_size = 2 output_size = len(set(LABELS)) num_hidd...
en
0.795709
# isn't ever used but we still set it # return terminate_for_loss_change or # step 0: fetch the data # step 1: zero the gradients # step 2: run the forward pass # step 3: compute the loss # step 4: compute the backward pass # step 5: have the optimizer take an optimization step # auxillary: bookkeeping
2.753719
3
mysite/api/v0/tests.py
raccoongang/socraticqs2
3
5292
<reponame>raccoongang/socraticqs2 import json import mock from django.core.urlresolvers import reverse from pymongo.errors import ServerSelectionTimeoutError from analytics.models import CourseReport from core.common.mongo import c_onboarding_status, _conn from core.common import onboarding from ct.models import Un...
import json import mock from django.core.urlresolvers import reverse from pymongo.errors import ServerSelectionTimeoutError from analytics.models import CourseReport from core.common.mongo import c_onboarding_status, _conn from core.common import onboarding from ct.models import UnitLesson, StudentError from ctms.t...
en
0.373129
Ping and Stats Mongo command return non ok results. Mongo query raises exception. # # Hack: remove all test_ databases before test # for db in _conn.connector.list_databases(): # if 'test_' in db.get('name') and: # _conn.connector.drop_database(db.get('name'))
2.16644
2
signbank/settings/base.py
anthonymark33/Global-signbank
0
5293
# Django settings for signbank project. import os from signbank.settings.server_specific import * from datetime import datetime DEBUG = True PROJECT_DIR = os.path.dirname(BASE_DIR) MANAGERS = ADMINS TIME_ZONE = 'Europe/Amsterdam' LOCALE_PATHS = [BASE_DIR+'conf/locale'] # in the database, SITE_ID 1 is example.com ...
# Django settings for signbank project. import os from signbank.settings.server_specific import * from datetime import datetime DEBUG = True PROJECT_DIR = os.path.dirname(BASE_DIR) MANAGERS = ADMINS TIME_ZONE = 'Europe/Amsterdam' LOCALE_PATHS = [BASE_DIR+'conf/locale'] # in the database, SITE_ID 1 is example.com ...
en
0.763072
# Django settings for signbank project. # in the database, SITE_ID 1 is example.com # Absolute path to the directory static files should be collected to. # Don't put anything in this directory yourself; store your static files # in apps' "static/" subdirectories and in STATICFILES_DIRS. # Example: "/home/media/media.la...
1.946353
2
ocs_ci/ocs/cluster.py
crombus/ocs-ci
0
5294
<filename>ocs_ci/ocs/cluster.py """ A module for all rook functionalities and abstractions. This module has rook related classes, support for functionalities to work with rook cluster. This works with assumptions that an OCP cluster is already functional and proper configurations are made for interaction. """ import ...
<filename>ocs_ci/ocs/cluster.py """ A module for all rook functionalities and abstractions. This module has rook related classes, support for functionalities to work with rook cluster. This works with assumptions that an OCP cluster is already functional and proper configurations are made for interaction. """ import ...
en
0.788985
A module for all rook functionalities and abstractions. This module has rook related classes, support for functionalities to work with rook cluster. This works with assumptions that an OCP cluster is already functional and proper configurations are made for interaction. Handles all cluster related operations from ceph...
2.179289
2
scenic/projects/baselines/detr/configs/detr_config.py
techthiyanes/scenic
0
5295
<reponame>techthiyanes/scenic<gh_stars>0 # pylint: disable=line-too-long r"""Default configs for COCO detection using DETR. """ # pylint: enable=line-too-long import copy import ml_collections _COCO_TRAIN_SIZE = 118287 NUM_EPOCHS = 300 def get_config(): """Returns the configuration for COCO detection using DETR."...
# pylint: disable=line-too-long r"""Default configs for COCO detection using DETR. """ # pylint: enable=line-too-long import copy import ml_collections _COCO_TRAIN_SIZE = 118287 NUM_EPOCHS = 300 def get_config(): """Returns the configuration for COCO detection using DETR.""" config = ml_collections.ConfigDict()...
en
0.79135
# pylint: disable=line-too-long Default configs for COCO detection using DETR. # pylint: enable=line-too-long Returns the configuration for COCO detection using DETR. # Dataset. # Model. # Same as hidden_size. # Loss. # Training. # Learning rate. # Note: this is absolute (not relative): # Backbone training configs: opt...
1.897585
2
tests/conftest.py
artembashlak/share-youtube-to-mail
0
5296
import pytest from selenium import webdriver from webdriver_manager.chrome import ChromeDriverManager @pytest.fixture(scope="function") def browser(): options = webdriver.ChromeOptions() options.add_argument('ignore-certificate-errors') options.add_argument("--headless") options.add_argument('--no-san...
import pytest from selenium import webdriver from webdriver_manager.chrome import ChromeDriverManager @pytest.fixture(scope="function") def browser(): options = webdriver.ChromeOptions() options.add_argument('ignore-certificate-errors') options.add_argument("--headless") options.add_argument('--no-san...
none
1
2.247401
2
prepare_cicero_peaks.py
lab-medvedeva/SCABFA-feature-selection
0
5297
<gh_stars>0 from scale.dataset import read_mtx from argparse import ArgumentParser import pandas as pd import numpy as np import os def parse_args(): parser = ArgumentParser('Preparing raw peaks from cicero pipeline') parser.add_argument('--dataset_path', help='Path to Scale dataset: count, feature, barcode...
from scale.dataset import read_mtx from argparse import ArgumentParser import pandas as pd import numpy as np import os def parse_args(): parser = ArgumentParser('Preparing raw peaks from cicero pipeline') parser.add_argument('--dataset_path', help='Path to Scale dataset: count, feature, barcode folder') ...
en
0.424589
# print(cell_type, cell_by_feature[np.argsort(cell_by_feature)[-args.num_peaks_threshold:]][:10])
2.83281
3
crusoe_observe/neo4j-client/neo4jclient/CMSClient.py
CSIRT-MU/CRUSOE
3
5298
<gh_stars>1-10 from neo4jclient.AbsClient import AbstractClient class CMSClient(AbstractClient): def __init__(self, password, **kwargs): super().__init__(password=password, **kwargs) def get_domain_names(self): """ Gets all domain names from database. :return: domain names in...
from neo4jclient.AbsClient import AbstractClient class CMSClient(AbstractClient): def __init__(self, password, **kwargs): super().__init__(password=password, **kwargs) def get_domain_names(self): """ Gets all domain names from database. :return: domain names in JSON-like form...
en
0.752945
Gets all domain names from database. :return: domain names in JSON-like form Gets all domain names with corresponding IPs from database. :return: IPs and DomainNames in JSON-like form Create nodes and relationships for cms client. ------------- Antivirus_query: 1. Parse csv giv...
2.678505
3
location.py
jonasjucker/wildlife-telegram
0
5299
import time from datetime import date,datetime from astral import LocationInfo from astral.sun import sun class CamLocation: def __init__(self,lat,lon,info,country,timezone): self.info = LocationInfo(info, country, timezone, lat, lon) def is_night(self): s = sun(self.info.observer, date=date.t...
import time from datetime import date,datetime from astral import LocationInfo from astral.sun import sun class CamLocation: def __init__(self,lat,lon,info,country,timezone): self.info = LocationInfo(info, country, timezone, lat, lon) def is_night(self): s = sun(self.info.observer, date=date.t...
none
1
3.297005
3