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
snake/hc.py
Wenbing-Yao/aigames
2
6620951
<gh_stars>1-10 # -*- coding: utf-8 -*- from copy import deepcopy from itertools import combinations from os.path import expandvars import ipdb import numpy as np import pygame from snake_env import SnakeEnv from snake_env import GRID_WIDTH_NUM from snake_env import GRID_HEIGHT_NUM from time import sleep import numpy...
# -*- coding: utf-8 -*- from copy import deepcopy from itertools import combinations from os.path import expandvars import ipdb import numpy as np import pygame from snake_env import SnakeEnv from snake_env import GRID_WIDTH_NUM from snake_env import GRID_HEIGHT_NUM from time import sleep import numpy as np from sna...
en
0.327114
# -*- coding: utf-8 -*- # env.reset() # for sp, ep in edges: # print('-' * 4 * deps, 'flags', ( # start, # ep, # ), flags[(start, ep)]) # print('-' * 4 * deps, 'start at', start, w) # print('-' * 4 * deps, 'found', edges) # print('-' * 4 * deps, ep) # print('-' * 4 * deps, 'found 1', start, ep) # visited.remove...
2.656873
3
app.py
sooftware/KoSpeech-Flask
3
6620952
import os import os.path import torch import librosa import soundfile as sf from modules.const import * from flask import Flask, request, render_template from werkzeug.utils import secure_filename from kospeech.utils import label_to_string, id2char, EOS_token from modules.parser import parse_audio from modules.converte...
import os import os.path import torch import librosa import soundfile as sf from modules.const import * from flask import Flask, request, render_template from werkzeug.utils import secure_filename from kospeech.utils import label_to_string, id2char, EOS_token from modules.parser import parse_audio from modules.converte...
en
0.708539
# Basic setting # Load weight file # Create object # PCM => WAV, WAV => PCM Convert recorded files to pcm Check file format # If hit play button # check condition # Convert format # Extract feature & Inference by model # Root page
2.333569
2
packs/processor/finescale_processing.py
CiceroAraujo/NU_ADM
0
6620953
import numpy as np import scipy.sparse as sp from scipy.sparse import linalg def newton_iteration_finescale(F_Jacobian, Ts, adjs, p, s, time_step, wells,all_ids, rel_tol=1e-3): pressure = p.copy() swns = s.copy() swn1s = s.copy() converged=False count=0 dt=time_step # data_impress['swn1s']=d...
import numpy as np import scipy.sparse as sp from scipy.sparse import linalg def newton_iteration_finescale(F_Jacobian, Ts, adjs, p, s, time_step, wells,all_ids, rel_tol=1e-3): pressure = p.copy() swns = s.copy() swn1s = s.copy() converged=False count=0 dt=time_step # data_impress['swn1s']=d...
en
0.251126
# data_impress['swn1s']=data_impress['swns'].copy() # all_ids=GID_0 # not_prod=np.setdiff1d(all_ids,wells['all_wells']) # Ts, adjs, Swns, Swn1s, F_Jacobian, ID_vol # J=FIM.J # q=FIM.q # converged=max(abs(sol[n:][not_prod]))<rel_tol # saturation[wells['ws_prod']]=saturation[wells['viz_prod']].sum()/len(wells['viz_prod']...
2.239981
2
sir/amqp/message.py
jsanzmex/sir
11
6620954
#!/usr/bin/env python # coding: utf-8 # Copyright (c) 2014 <NAME> # License: MIT, see LICENSE for details """ This module contains functions and classes to parse and represent the content of an AMQP message. """ from sir.trigger_generation.sql_generator import MSG_JSON_TABLE_NAME_KEY, MSG_JSON_OPERATION_TYPE from enum ...
#!/usr/bin/env python # coding: utf-8 # Copyright (c) 2014 <NAME> # License: MIT, see LICENSE for details """ This module contains functions and classes to parse and represent the content of an AMQP message. """ from sir.trigger_generation.sql_generator import MSG_JSON_TABLE_NAME_KEY, MSG_JSON_OPERATION_TYPE from enum ...
en
0.702803
#!/usr/bin/env python # coding: utf-8 # Copyright (c) 2014 <NAME> # License: MIT, see LICENSE for details This module contains functions and classes to parse and represent the content of an AMQP message. A parsed message from AMQP. Construct a new message object. A message contains a set of columns (dict) whic...
2.737389
3
snippet_fmt/__init__.py
python-formate/snippet-fmt
0
6620955
#!/usr/bin/env python3 # # __init__.py """ Format and validate code snippets in reStructuredText files. """ # # Copyright © 2021 <NAME> <<EMAIL>> # # 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...
#!/usr/bin/env python3 # # __init__.py """ Format and validate code snippets in reStructuredText files. """ # # Copyright © 2021 <NAME> <<EMAIL>> # # 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...
en
0.780825
#!/usr/bin/env python3 # # __init__.py Format and validate code snippets in reStructuredText files. # # Copyright © 2021 <NAME> <<EMAIL>> # # 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 Softwar...
1.580421
2
ffws/parser/SpectraMaxM2.py
mojaie/flashflood-workspace-sample
0
6620956
<gh_stars>0 import csv def content_loader(lines): """Load datafile from SpectraMax M2. TODO: multilayer Args: lines: lines of input file (or file object) Returns: parsed data """ bs = 20 # block_size bo = 1 # block_offset pr = 16 # plate_rows ro = 2 # row_off...
import csv def content_loader(lines): """Load datafile from SpectraMax M2. TODO: multilayer Args: lines: lines of input file (or file object) Returns: parsed data """ bs = 20 # block_size bo = 1 # block_offset pr = 16 # plate_rows ro = 2 # row_offset pc = ...
en
0.298939
Load datafile from SpectraMax M2. TODO: multilayer Args: lines: lines of input file (or file object) Returns: parsed data # block_size # block_offset # plate_rows # row_offset # plate_cols # col_offset
2.759207
3
pipelitools/preprocessing/features.py
nastiag67/tools
1
6620957
<filename>pipelitools/preprocessing/features.py import pandas as pd import numpy as np from datetime import datetime from sklearn.feature_selection import VarianceThreshold, RFE, SelectFromModel from sklearn.ensemble import RandomForestClassifier, ExtraTreesClassifier from sklearn.preprocessing import StandardScaler ...
<filename>pipelitools/preprocessing/features.py import pandas as pd import numpy as np from datetime import datetime from sklearn.feature_selection import VarianceThreshold, RFE, SelectFromModel from sklearn.ensemble import RandomForestClassifier, ExtraTreesClassifier from sklearn.preprocessing import StandardScaler ...
en
0.73475
A pipeline for feature selection Note: Assumes the response is the last column in df. Parameters ---------- df : pd.DataFrame Dataframe used for feature selection (includes features and the response). Feature selection based on low variance. Parameters ---------- thres...
3.609996
4
CursoemVideo/ex027.py
arthxvr/coding--python
0
6620958
<gh_stars>0 nome = str(input('Nome completo: ')).strip() print(f'Primeiro nome = {nome.split()[0]}') print(f'Último nome = {nome.split()[-1]}')
nome = str(input('Nome completo: ')).strip() print(f'Primeiro nome = {nome.split()[0]}') print(f'Último nome = {nome.split()[-1]}')
none
1
3.704049
4
code/utils/scripts/outliers_script.py
berkeley-stat159/project-alpha
4
6620959
""" Script to identify outliers for each subject. Compares the mean MRSS values from running GLM on the basic np.convolve convolved time course, before and after dropping the outliers. """ from __future__ import absolute_import, division, print_function import numpy as np import nibabel as nib import os import sys...
""" Script to identify outliers for each subject. Compares the mean MRSS values from running GLM on the basic np.convolve convolved time course, before and after dropping the outliers. """ from __future__ import absolute_import, division, print_function import numpy as np import nibabel as nib import os import sys...
en
0.851229
Script to identify outliers for each subject. Compares the mean MRSS values from running GLM on the basic np.convolve convolved time course, before and after dropping the outliers. # Relative paths to project and data. # List to store the mean MRSS values before and after outlier removal # saving to compare number of...
2.69921
3
Advanced_algorithm/oj_homework3/4.py
mndream/MyOJ
1
6620960
""" 棋盘覆盖问题: 给定一个大小为2^n * 2^n个小方格的棋盘,其中有一个位置已经被填充, 现在要用一个L型(2 * 2个小方格组成的大方格中去掉其中一个小方格)形状去覆盖剩下的小方格。 求出覆盖方案,即哪些坐标下的小方格使用同一个L型格子覆盖。注意:坐标从0开始。 左上方的第一个格子坐标为(0,0),第一行第二个坐标为(0,1),第二行第一个为(1,0),以此类推。 输入: 第一行为测试用例个数,后面每一个用例有两行, 第一行为n值和特殊的格子的坐标(用空格隔开), 第二行为需要查找其属于同一个L型格子的格子坐标。 输出: 每一行为一个用例的解,先按照行值从小到大、 再按照列值从小到大的顺序输出每一个用例的两个坐标;用...
""" 棋盘覆盖问题: 给定一个大小为2^n * 2^n个小方格的棋盘,其中有一个位置已经被填充, 现在要用一个L型(2 * 2个小方格组成的大方格中去掉其中一个小方格)形状去覆盖剩下的小方格。 求出覆盖方案,即哪些坐标下的小方格使用同一个L型格子覆盖。注意:坐标从0开始。 左上方的第一个格子坐标为(0,0),第一行第二个坐标为(0,1),第二行第一个为(1,0),以此类推。 输入: 第一行为测试用例个数,后面每一个用例有两行, 第一行为n值和特殊的格子的坐标(用空格隔开), 第二行为需要查找其属于同一个L型格子的格子坐标。 输出: 每一行为一个用例的解,先按照行值从小到大、 再按照列值从小到大的顺序输出每一个用例的两个坐标;用...
zh
0.993872
棋盘覆盖问题: 给定一个大小为2^n * 2^n个小方格的棋盘,其中有一个位置已经被填充, 现在要用一个L型(2 * 2个小方格组成的大方格中去掉其中一个小方格)形状去覆盖剩下的小方格。 求出覆盖方案,即哪些坐标下的小方格使用同一个L型格子覆盖。注意:坐标从0开始。 左上方的第一个格子坐标为(0,0),第一行第二个坐标为(0,1),第二行第一个为(1,0),以此类推。 输入: 第一行为测试用例个数,后面每一个用例有两行, 第一行为n值和特殊的格子的坐标(用空格隔开), 第二行为需要查找其属于同一个L型格子的格子坐标。 输出: 每一行为一个用例的解,先按照行值从小到大、 再按照列值从小到大的顺序输出每一个用例的两个坐标;用逗号隔开...
4.150178
4
features/steps/user_steps.py
gekkeharry13/api-python
1
6620961
from behave import when, then import conjur @when("I create a user") def step_create_user(context): context.user_id = context.random_string('api-python-user') context.user = context.api.create_user(context.user_id) @when('I create a user "{name}"') def step_creaet_user_named(context, name): context.user...
from behave import when, then import conjur @when("I create a user") def step_create_user(context): context.user_id = context.random_string('api-python-user') context.user = context.api.create_user(context.user_id) @when('I create a user "{name}"') def step_creaet_user_named(context, name): context.user...
none
1
2.67096
3
main.py
fablab-wue/MicroPythinShow
1
6620962
import network import time # load WLAN credentials from WLAN_PW import SSID, PASSWORD # define function to start network def net(): sta_if = network.WLAN(network.STA_IF) sta_if.active(True) if not sta_if.isconnected(): # Check if connected print('Connecting to WiFi "{}"'.format(SSID)...
import network import time # load WLAN credentials from WLAN_PW import SSID, PASSWORD # define function to start network def net(): sta_if = network.WLAN(network.STA_IF) sta_if.active(True) if not sta_if.isconnected(): # Check if connected print('Connecting to WiFi "{}"'.format(SSID)...
en
0.7921
# load WLAN credentials # define function to start network # Check if connected # Connect to an AP # Check for successful connection # load CLI commands
2.932592
3
cloudmersive_nlp_api_client/models/word_position.py
Cloudmersive/Cloudmersive.APIClient.Python.NLP
1
6620963
# coding: utf-8 """ nlpapiv2 The powerful Natural Language Processing APIs (v2) let you perform part of speech tagging, entity identification, sentence parsing, and much more to help you understand the meaning of unstructured text. # noqa: E501 OpenAPI spec version: v1 Generated by: https://git...
# coding: utf-8 """ nlpapiv2 The powerful Natural Language Processing APIs (v2) let you perform part of speech tagging, entity identification, sentence parsing, and much more to help you understand the meaning of unstructured text. # noqa: E501 OpenAPI spec version: v1 Generated by: https://git...
en
0.745192
# coding: utf-8 nlpapiv2 The powerful Natural Language Processing APIs (v2) let you perform part of speech tagging, entity identification, sentence parsing, and much more to help you understand the meaning of unstructured text. # noqa: E501 OpenAPI spec version: v1 Generated by: https://github.com/s...
2.681377
3
config/flask_config.py
iqDF/receiptbook-service
1
6620964
import os SQLALCHEMY_DATABASE_URI = 'sqlite:////home/iqdf/Development/OSSHackathon/test.db'
import os SQLALCHEMY_DATABASE_URI = 'sqlite:////home/iqdf/Development/OSSHackathon/test.db'
none
1
1.207754
1
xdgconfig/__init__.py
Dogeek/pyconf
1
6620965
# flake8: noqa from platform import system import xdgconfig.mixins as mixins __version__ = '1.2.1' if system() == 'Windows': from xdgconfig.config_win import WinConfig as Config elif system() in ('Darwin', 'Linux') or system().startswith('CYGWIN'): from xdgconfig.config_unix import UnixConfig as Config els...
# flake8: noqa from platform import system import xdgconfig.mixins as mixins __version__ = '1.2.1' if system() == 'Windows': from xdgconfig.config_win import WinConfig as Config elif system() in ('Darwin', 'Linux') or system().startswith('CYGWIN'): from xdgconfig.config_unix import UnixConfig as Config els...
it
0.238973
# flake8: noqa
2.234133
2
src/genie/libs/parser/iosxe/tests/ShowProcessesCpu/cli/equal/golden_output_1_expected.py
balmasea/genieparser
204
6620966
<filename>src/genie/libs/parser/iosxe/tests/ShowProcessesCpu/cli/equal/golden_output_1_expected.py expected_output = { "sort": { 1: { "five_min_cpu": 0.0, "five_sec_cpu": 0.0, "invoked": 1, "one_min_cpu": 0.0, "pid": 100, "process": "cp...
<filename>src/genie/libs/parser/iosxe/tests/ShowProcessesCpu/cli/equal/golden_output_1_expected.py expected_output = { "sort": { 1: { "five_min_cpu": 0.0, "five_sec_cpu": 0.0, "invoked": 1, "one_min_cpu": 0.0, "pid": 100, "process": "cp...
none
1
1.583647
2
vmodel/dataset.py
lis-epfl/vmodel
0
6620967
import pickle from datetime import datetime import numpy as np import pandas as pd import xarray as xr import yaml from vmodel.util.util import clean_attrs def generate_filename(args): # Construct output file name time_str = datetime.now().strftime('%Y-%m-%d-%H-%M-%S') fnamedict = { 'agents': a...
import pickle from datetime import datetime import numpy as np import pandas as pd import xarray as xr import yaml from vmodel.util.util import clean_attrs def generate_filename(args): # Construct output file name time_str = datetime.now().strftime('%Y-%m-%d-%H-%M-%S') fnamedict = { 'agents': a...
en
0.796745
# Construct output file name # Clean up attrs dict to be compatible with YAML and NETCDF # Return only state (position and velocity) # Tranpose to match data generated from Gazebo
2.265958
2
tests/component/records/targets/test_data_url.py
cwegrzyn/records-mover
36
6620968
import unittest from records_mover.url.filesystem import FilesystemFileUrl from records_mover.records.targets.data_url import DataUrlTarget from records_mover.records.records_format import DelimitedRecordsFormat class TestDataUrlTarget(unittest.TestCase): def test_gzip_compression_inferred_no_records_format(self)...
import unittest from records_mover.url.filesystem import FilesystemFileUrl from records_mover.records.targets.data_url import DataUrlTarget from records_mover.records.records_format import DelimitedRecordsFormat class TestDataUrlTarget(unittest.TestCase): def test_gzip_compression_inferred_no_records_format(self)...
none
1
2.69883
3
template.py
jo3-l/advent
0
6620969
from collections import defaultdict, Counter, deque from functools import cache import math import re import itertools import os from heapq import heappush, heappop adj4 = ((0, -1), (0, 1), (1, 0), (-1, 0)) adj8 = ((1, 0), (-1, 0), (0, 1), (0, -1), (1, -1), (1, 1), (-1, 1), (-1, -1)) def lmap(f, it): return list...
from collections import defaultdict, Counter, deque from functools import cache import math import re import itertools import os from heapq import heappush, heappop adj4 = ((0, -1), (0, 1), (1, 0), (-1, 0)) adj8 = ((1, 0), (-1, 0), (0, 1), (0, -1), (1, -1), (1, 1), (-1, 1), (-1, -1)) def lmap(f, it): return list...
none
1
2.999292
3
maestral/gui/utils.py
michaelbjames/maestral-dropbox
0
6620970
<filename>maestral/gui/utils.py # !/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Oct 31 16:23:13 2018 @author: samschott """ # system imports import sys import os import platform from subprocess import Popen from traceback import format_exception # external packages from PyQt5 import QtCore, QtGui,...
<filename>maestral/gui/utils.py # !/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Oct 31 16:23:13 2018 @author: samschott """ # system imports import sys import os import platform from subprocess import Popen from traceback import format_exception # external packages from PyQt5 import QtCore, QtGui,...
en
0.736732
# !/usr/bin/env python3 # -*- coding: utf-8 -*- Created on Wed Oct 31 16:23:13 2018 @author: samschott # system imports # external packages # maestral modules Elide a string to fit into the given width. :param str string: String to elide. :param font: Font to calculate size. If not given, the current style's ...
2.233829
2
aiosvc/db/__init__.py
acsnem/aiosvc
0
6620971
from .pg import Pool as PgPool
from .pg import Pool as PgPool
none
1
1.075379
1
test_framework/show_versions.py
jamescooke/factory_djoy
26
6620972
<gh_stars>10-100 import sys from django import get_version def versions(): return ''' === VERSIONS ====================== Python = {python} Django = {django} =================================== '''.format( python=sys.version.replace('\n', ' '), django=get_version(), ) if __name__ == '__ma...
import sys from django import get_version def versions(): return ''' === VERSIONS ====================== Python = {python} Django = {django} =================================== '''.format( python=sys.version.replace('\n', ' '), django=get_version(), ) if __name__ == '__main__': print(...
en
0.345826
=== VERSIONS ====================== Python = {python} Django = {django} ===================================
2.24897
2
Microassembly/CPU-16 Micro Assembler.py
techno-sorcery/CPU-16
0
6620973
<filename>Microassembly/CPU-16 Micro Assembler.py ########################################## # ATLAS CPU-16 MICRO-ASSEMBLER # # WRITTEN BY <NAME>. - 2022 # ########################################## import re import sys import os mcode = { 'PC_ST' :'0b0000000000000000000000000000100000000...
<filename>Microassembly/CPU-16 Micro Assembler.py ########################################## # ATLAS CPU-16 MICRO-ASSEMBLER # # WRITTEN BY <NAME>. - 2022 # ########################################## import re import sys import os mcode = { 'PC_ST' :'0b0000000000000000000000000000100000000...
en
0.333783
########################################## # ATLAS CPU-16 MICRO-ASSEMBLER # # WRITTEN BY <NAME>. - 2022 # ########################################## #path = sys.argv[1] #First pass - Find labels & parse instructions #Find labels #print(line) #print() #print(labels) #print() #print(words) #print() #...
1.917695
2
nobrainer/bayesian_utils.py
richford/nobrainer
2
6620974
<gh_stars>1-10 import numpy as np import tensorflow as tf import tensorflow.compat.v2 as tf2 from tensorflow.python.ops import nn_impl import tensorflow_probability as tfp from tensorflow_probability.python import util as tfp_util from tensorflow_probability.python.distributions import ( deterministic as determinis...
import numpy as np import tensorflow as tf import tensorflow.compat.v2 as tf2 from tensorflow.python.ops import nn_impl import tensorflow_probability as tfp from tensorflow_probability.python import util as tfp_util from tensorflow_probability.python.distributions import ( deterministic as deterministic_lib, ) from...
en
0.424684
Creates `loc`, `scale` parameters. # loc = tfp_util.DeferredTensor(loc, lambda x: (nn_impl.l2_normalize(x))) # tf.keras.regularizers.l2(), #None # tf.keras.regularizers.l2(), #None # tf.keras.constraints.UnitNorm(axis = [0, 1, 2,3]), Defines normal distributions prior for Bayesian neural network.
2.18167
2
tests/models/test_group.py
SungardAS/porper-core
0
6620975
import sys sys.path.append('../../porper') import os region = os.environ.get('AWS_DEFAULT_REGION') import boto3 dynamodb = boto3.resource('dynamodb',region_name=region) from models.group import Group group = Group(dynamodb) params = {'name': 'public'} group.create(params) params = {'id': '1234', 'name': 'new'} gro...
import sys sys.path.append('../../porper') import os region = os.environ.get('AWS_DEFAULT_REGION') import boto3 dynamodb = boto3.resource('dynamodb',region_name=region) from models.group import Group group = Group(dynamodb) params = {'name': 'public'} group.create(params) params = {'id': '1234', 'name': 'new'} gro...
none
1
2.16917
2
app/libs/face_detection/tests/test_face_detection_facade.py
guischroeder/hackattic-basic-face-detection
1
6620976
<reponame>guischroeder/hackattic-basic-face-detection import requests from io import BytesIO from app.libs.hackattic.hackattic_service import HackatticService from app.libs.aws.aws_client import AWSClient from app.libs.aws.s3_service import S3Service from app.libs.aws.rekognition_service import RekognitionService fro...
import requests from io import BytesIO from app.libs.hackattic.hackattic_service import HackatticService from app.libs.aws.aws_client import AWSClient from app.libs.aws.s3_service import S3Service from app.libs.aws.rekognition_service import RekognitionService from app.libs.face_detection.positions_service import Pos...
none
1
2.173446
2
unitconv/__init__.py
facundobatista/unitconv
2
6620977
# Copyright 2010-2018 Canonical Ltd. # Copyright 2020 <NAME> # All Rights Reserved """A units converter.""" import collections import itertools import logging import math import random import re import sys import pint __all__ = ['convert'] logger = logging.getLogger(__name__) _ureg = pint.UnitRegistry() UnitInfo...
# Copyright 2010-2018 Canonical Ltd. # Copyright 2020 <NAME> # All Rights Reserved """A units converter.""" import collections import itertools import logging import math import random import re import sys import pint __all__ = ['convert'] logger = logging.getLogger(__name__) _ureg = pint.UnitRegistry() UnitInfo...
en
0.806722
# Copyright 2010-2018 Canonical Ltd. # Copyright 2020 <NAME> # All Rights Reserved A units converter. # crazy regex to match a number; this comes from the Python's Decimal code, # adapted to support also commas # A numeric string consists of: (?=\d|\.\d|\,\d) # starts with a number or a point/comma (?...
3.373235
3
tests/resources/config/default_config_2.py
elijahbenizzy/hamilton
298
6620978
<filename>tests/resources/config/default_config_2.py<gh_stars>100-1000 def some_key() -> str: return 'some_value'
<filename>tests/resources/config/default_config_2.py<gh_stars>100-1000 def some_key() -> str: return 'some_value'
none
1
1.494413
1
rainy/envs/ext.py
alexmlamb/blocks_rl_gru_setup
0
6620979
<gh_stars>0 from abc import ABC import gym from gym import spaces from numpy import ndarray from typing import Any, Generic, Tuple from ..prelude import Action, State class EnvSpec: def __init__( self, state_dim: Tuple[int, ...], action_space: gym.Space, use_reward_...
from abc import ABC import gym from gym import spaces from numpy import ndarray from typing import Any, Generic, Tuple from ..prelude import Action, State class EnvSpec: def __init__( self, state_dim: Tuple[int, ...], action_space: gym.Space, use_reward_monitor: boo...
en
0.855157
Properties which are common both in EnvExt and ParallelEnv Inherited from gym.Env. Inherited from gym.Env. Inherited from gym.Env. Inherited from gym.Env. Inherited from gym.Env. Inherited from gym.Env. Extended method. Returns a ndim of action space. Extended method. Returns a shape of observation spac...
2.43961
2
TexasCovidLast40Days.py
gregwa1953/FCM-171
0
6620980
<filename>TexasCovidLast40Days.py<gh_stars>0 import plotext as plt data = [ 2520151, 2522016, 2523617, 2524212, 2524688, 2525991, 2527350, 2529068, 2530176, 2530658, 2530910, 2531194, 2532112, 2533123, 2534149, 2534730, 2536217, 2536646, 2536691, 2538120, 2538908, 2540318, 2541586, 2542877, 2543158, 25...
<filename>TexasCovidLast40Days.py<gh_stars>0 import plotext as plt data = [ 2520151, 2522016, 2523617, 2524212, 2524688, 2525991, 2527350, 2529068, 2530176, 2530658, 2530910, 2531194, 2532112, 2533123, 2534149, 2534730, 2536217, 2536646, 2536691, 2538120, 2538908, 2540318, 2541586, 2542877, 2543158, 25...
none
1
3.092186
3
dist-packages/deepin_utils/multithread.py
Jianwei-Wang/python2.7_lib
0
6620981
#! /usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2011 ~ 2012 Deepin, Inc. # 2011 ~ 2012 Wang Yong # # Author: <NAME> <<EMAIL>> # Maintainer: <NAME> <<EMAIL>> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License...
#! /usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2011 ~ 2012 Deepin, Inc. # 2011 ~ 2012 Wang Yong # # Author: <NAME> <<EMAIL>> # Maintainer: <NAME> <<EMAIL>> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License...
en
0.818903
#! /usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2011 ~ 2012 Deepin, Inc. # 2011 ~ 2012 Wang Yong # # Author: <NAME> <<EMAIL>> # Maintainer: <NAME> <<EMAIL>> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as...
3.286192
3
tests/test_responses/test_response_spec.py
adriangb/xpresso
75
6620982
from typing import Any, Dict, List, Tuple, Union from pydantic import BaseModel from xpresso import App, Operation, Path from xpresso.responses import FileResponse, JSONResponse, ResponseSpec from xpresso.testclient import TestClient def test_default_response_spec_merge_with_top_level_parameters() -> None: asyn...
from typing import Any, Dict, List, Tuple, Union from pydantic import BaseModel from xpresso import App, Operation, Path from xpresso.responses import FileResponse, JSONResponse, ResponseSpec from xpresso.testclient import TestClient def test_default_response_spec_merge_with_top_level_parameters() -> None: asyn...
none
1
2.213365
2
deploy.py
unit9/gae-flex-deploy
0
6620983
#! /usr/bin/env python3 from settings import PROJECT_NAME from yaml import dump, load import argparse import os import subprocess import shutil from hashlib import sha256 def rreplace(s, old, new, occurrence=1): li = s.rsplit(old, occurrence) return new.join(li) CONFIGS_BUCKET = 'gs://{}-configs/'.format(P...
#! /usr/bin/env python3 from settings import PROJECT_NAME from yaml import dump, load import argparse import os import subprocess import shutil from hashlib import sha256 def rreplace(s, old, new, occurrence=1): li = s.rsplit(old, occurrence) return new.join(li) CONFIGS_BUCKET = 'gs://{}-configs/'.format(P...
en
0.479036
#! /usr/bin/env python3 # get full paths # checking if files exist # load files # cuz of windows file access
2.251936
2
src/C2B_Simulate.py
KahigaKiguru/Daraja-API-Test
2
6620984
<filename>src/C2B_Simulate.py import authenticate_app import user_credentials import requests def register_url(): access_token = authenticate_app.access_token api_url = user_credentials.register_api_url headers = {"Authorization": "Bearer %s" %access_token} request = { "ShortCode": us...
<filename>src/C2B_Simulate.py import authenticate_app import user_credentials import requests def register_url(): access_token = authenticate_app.access_token api_url = user_credentials.register_api_url headers = {"Authorization": "Bearer %s" %access_token} request = { "ShortCode": us...
none
1
2.711134
3
lib/search/priorityqueue.py
timofurrer/aoc-2020
0
6620985
import heapq class PriorityQueue: """A Queue in which the minimum (or maximum) element (as determined by f and order) is returned first. If order is 'min', the item with minimum f(x) is returned first; if order is 'max', then it is the item with maximum f(x). Also supports dict-like lookup.""" ...
import heapq class PriorityQueue: """A Queue in which the minimum (or maximum) element (as determined by f and order) is returned first. If order is 'min', the item with minimum f(x) is returned first; if order is 'max', then it is the item with maximum f(x). Also supports dict-like lookup.""" ...
en
0.877411
A Queue in which the minimum (or maximum) element (as determined by f and order) is returned first. If order is 'min', the item with minimum f(x) is returned first; if order is 'max', then it is the item with maximum f(x). Also supports dict-like lookup. # now item with max f(x) # will be popped first I...
4.349817
4
app/http/controllers/PlateController.py
zhaozhentao/MasoniteML
0
6620986
"""A PlateController Module.""" from masonite import Upload from masonite.controllers import Controller from masonite.request import Request from app.providers.DLModelProvider import DLModelProvider class PlateController(Controller): """PlateController Controller Class.""" def __init__(self, request: Reques...
"""A PlateController Module.""" from masonite import Upload from masonite.controllers import Controller from masonite.request import Request from app.providers.DLModelProvider import DLModelProvider class PlateController(Controller): """PlateController Controller Class.""" def __init__(self, request: Reques...
en
0.330413
A PlateController Module. PlateController Controller Class. PlateController Initializer Arguments: request {masonite.request.Request} -- The Masonite Request class.
2.853762
3
Menu.py
AStox/tankbot
0
6620987
<gh_stars>0 ''' Copyright 2014 <NAME> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in ...
''' Copyright 2014 <NAME> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, sof...
en
0.876396
Copyright 2014 <NAME> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, softwar...
2.405761
2
python/project-euler/euler_2.py
indeshan/code
0
6620988
<filename>python/project-euler/euler_2.py prev, cur = 0, 1 total = 0 while True: prev, cur = cur, prev + cur if cur >= 4000000: break if cur % 2 == 0: total += cur print(total)
<filename>python/project-euler/euler_2.py prev, cur = 0, 1 total = 0 while True: prev, cur = cur, prev + cur if cur >= 4000000: break if cur % 2 == 0: total += cur print(total)
none
1
3.148696
3
odoo-13.0/addons/l10n_in_sale_stock/models/stock_warehouse.py
VaibhavBhujade/Blockchain-ERP-interoperability
0
6620989
<filename>odoo-13.0/addons/l10n_in_sale_stock/models/stock_warehouse.py # -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import models, fields, api class Stock(models.Model): _inherit = 'stock.warehouse' l10n_in_sale_journal_id = fields.Many2one('a...
<filename>odoo-13.0/addons/l10n_in_sale_stock/models/stock_warehouse.py # -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import models, fields, api class Stock(models.Model): _inherit = 'stock.warehouse' l10n_in_sale_journal_id = fields.Many2one('a...
en
0.860833
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details.
1.239346
1
MLTL_Compiler/__init__.py
zpcore/Web_MLTL_Compiler
0
6620990
from .postgraph import Postgraph from .Observer import *
from .postgraph import Postgraph from .Observer import *
none
1
1.020479
1
tests/test_fuzz_lib.py
NESCAU-UFLA/FuzzyingTool
0
6620991
import unittest from unittest.mock import Mock, patch from src.fuzzingtool.fuzz_lib import FuzzLib from src.fuzzingtool.conn.requesters import Requester, SubdomainRequester from src.fuzzingtool.utils.consts import PluginCategory, FUZZING_MARK from src.fuzzingtool.exceptions import FuzzLibException, WordlistCreationErr...
import unittest from unittest.mock import Mock, patch from src.fuzzingtool.fuzz_lib import FuzzLib from src.fuzzingtool.conn.requesters import Requester, SubdomainRequester from src.fuzzingtool.utils.consts import PluginCategory, FUZZING_MARK from src.fuzzingtool.exceptions import FuzzLibException, WordlistCreationErr...
none
1
2.396577
2
chapter05/bar.py
teleported/ds-fromscratch
0
6620992
<filename>chapter05/bar.py #!/usr/bin/python import matplotlib matplotlib.use('Qt4Agg') import random from collections import Counter from matplotlib import pyplot as plt num_friends = [random.choice(range(20)) for _ in range(200)] friend_counter = Counter(num_friends) xs = range(21) ys = [friend_counter[x] for x i...
<filename>chapter05/bar.py #!/usr/bin/python import matplotlib matplotlib.use('Qt4Agg') import random from collections import Counter from matplotlib import pyplot as plt num_friends = [random.choice(range(20)) for _ in range(200)] friend_counter = Counter(num_friends) xs = range(21) ys = [friend_counter[x] for x i...
en
0.370167
#!/usr/bin/python # plt.xticks(xs , xs)
3.231181
3
good_spot/populartimes/admin.py
jasmine92122/NightClubBackend
0
6620993
<reponame>jasmine92122/NightClubBackend from django.contrib import admin from django.contrib.postgres.fields import JSONField from prettyjson import PrettyJSONWidget from good_spot.populartimes.models import Populartimes @admin.register(Populartimes) class PopulartimesAdmin(admin.ModelAdmin): formfield_overrides...
from django.contrib import admin from django.contrib.postgres.fields import JSONField from prettyjson import PrettyJSONWidget from good_spot.populartimes.models import Populartimes @admin.register(Populartimes) class PopulartimesAdmin(admin.ModelAdmin): formfield_overrides = { JSONField: {'widget': Prett...
none
1
1.513608
2
pymodaq_plugins/hardware/Newport/esp100.py
Cdriko/pymodaq_plugins
0
6620994
import pyvisa import numpy as np class ESP100(object): def __init__(self): super().__init__() self._controller = None self._VISA_rm = pyvisa.ResourceManager() self.com_ports = self.get_ressources() @property def timeout(self): return self._timeout @timeout.se...
import pyvisa import numpy as np class ESP100(object): def __init__(self): super().__init__() self._controller = None self._VISA_rm = pyvisa.ResourceManager() self.com_ports = self.get_ressources() @property def timeout(self): return self._timeout @timeout.se...
en
0.227171
#set attributes #self._controller.flow_control = 0 # self._controller.read_termination=self._controller.LF # self._controller.write_termination=self._controller.LF return the given axis position always in mm
2.576441
3
build/PureCloudPlatformClientV2/models/create_web_chat_conversation_request.py
cjohnson-ctl/platform-client-sdk-python
10
6620995
<reponame>cjohnson-ctl/platform-client-sdk-python<gh_stars>1-10 # coding: utf-8 """ Copyright 2016 SmartBear Software 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...
# coding: utf-8 """ Copyright 2016 SmartBear Software Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applica...
en
0.78724
# coding: utf-8 Copyright 2016 SmartBear Software 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 l...
1.540727
2
tests/unit/test_toolchain.py
ericsonj/pymaketool
6
6620996
<gh_stars>1-10 import unittest from pymakelib import toolchain class TestToolchain(unittest.TestCase): def test_confgcc(self): res = toolchain.confGCC(binLocation="/usr/bin/") self.assertEqual("/usr/bin/gcc", res['CC']) res = toolchain.confGCC(binLocation="/usr/bin") self.assertEq...
import unittest from pymakelib import toolchain class TestToolchain(unittest.TestCase): def test_confgcc(self): res = toolchain.confGCC(binLocation="/usr/bin/") self.assertEqual("/usr/bin/gcc", res['CC']) res = toolchain.confGCC(binLocation="/usr/bin") self.assertEqual("/usr/bin/g...
none
1
2.328085
2
jupyterlab_powerpoint/tests/test_init.py
timkpaine/jupyterlab_powerpoint
19
6620997
<reponame>timkpaine/jupyterlab_powerpoint<gh_stars>10-100 # for Coverage from jupyterlab_powerpoint import _jupyter_server_extension_paths class TestInit: def test__jupyter_server_extension_paths(self): assert _jupyter_server_extension_paths() == [ {"module": "jupyterlab_powerpoint.extension"}...
# for Coverage from jupyterlab_powerpoint import _jupyter_server_extension_paths class TestInit: def test__jupyter_server_extension_paths(self): assert _jupyter_server_extension_paths() == [ {"module": "jupyterlab_powerpoint.extension"} ]
en
0.887398
# for Coverage
1.784336
2
src/baseline/exnn/setup.py
fau-is/gam_comparison
1
6620998
from setuptools import setup setup(name='exnn', version='0.1', description='The enhanced explainable neural network with sparse, orthogonal and smooth constraints', url='https://github.com/ZebinYang/exnn', author='<NAME>', author_email='<EMAIL>', license='GPL', packages=['exnn...
from setuptools import setup setup(name='exnn', version='0.1', description='The enhanced explainable neural network with sparse, orthogonal and smooth constraints', url='https://github.com/ZebinYang/exnn', author='<NAME>', author_email='<EMAIL>', license='GPL', packages=['exnn...
none
1
1.129175
1
logger.py
SadoP/DiscordRolesFromSheets
0
6620999
<filename>logger.py import logging logger = logging.getLogger("logger") logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s') logger.setLevel(logging.INFO)
<filename>logger.py import logging logger = logging.getLogger("logger") logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s') logger.setLevel(logging.INFO)
none
1
2.567354
3
src/golem.py
ignavier/golem
10
6621000
import os from models import GolemModel from trainers import GolemTrainer # For logging of tensorflow messages os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' def golem(X, lambda_1, lambda_2, equal_variances=True, num_iter=1e+5, learning_rate=1e-3, seed=1, checkpoint_iter=None, output_dir=None, B_init...
import os from models import GolemModel from trainers import GolemTrainer # For logging of tensorflow messages os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' def golem(X, lambda_1, lambda_2, equal_variances=True, num_iter=1e+5, learning_rate=1e-3, seed=1, checkpoint_iter=None, output_dir=None, B_init...
en
0.70785
# For logging of tensorflow messages Solve the unconstrained optimization problem of GOLEM, which involves GolemModel and GolemTrainer. Args: X (numpy.ndarray): [n, d] data matrix. lambda_1 (float): Coefficient of L1 penalty. lambda_2 (float): Coefficient of DAG penalty. equ...
2.410259
2
2020/5.1/main.py
kylixalex/Advent-of-Code
0
6621001
<reponame>kylixalex/Advent-of-Code<filename>2020/5.1/main.py<gh_stars>0 inp = open("input.txt").read().splitlines() li = [] for line in inp: binary = str.maketrans("FBLR", "0101") translated = int(line.translate(binary), 2) li.append(translated) print(max(li))
inp = open("input.txt").read().splitlines() li = [] for line in inp: binary = str.maketrans("FBLR", "0101") translated = int(line.translate(binary), 2) li.append(translated) print(max(li))
none
1
3.129653
3
dexp/utils/robocopy.py
haesleinhuepf/dexp
16
6621002
import os import subprocess from arbol import aprint, asection def robocopy( source_folder: str, dest_folder: str, move_files: bool = False, nb_threads: int = 8, large_files: bool = False, wait_to_finish: bool = True, ): """ Start a generic robocopy job on Windows to copy files from o...
import os import subprocess from arbol import aprint, asection def robocopy( source_folder: str, dest_folder: str, move_files: bool = False, nb_threads: int = 8, large_files: bool = False, wait_to_finish: bool = True, ): """ Start a generic robocopy job on Windows to copy files from o...
en
0.744428
Start a generic robocopy job on Windows to copy files from one folder to another Args --------- Returns --------- copyProcess (Popen Object) : > this is the Popen object that's running the copy process. This can be > used to check or kill the process if necessary. # checks for network file...
3.043097
3
pipot/services/ServiceModelsManager.py
VertexC/pipot-server
4
6621003
<filename>pipot/services/ServiceModelsManager.py<gh_stars>1-10 # The models is stored in models.txt as # [serviceName1].[tableName1] # [serviceName1].[tableName2] # [serviceName2].[tableName1] from __future__ import print_function import os import sys import importlib import inspect from database import Base models_s...
<filename>pipot/services/ServiceModelsManager.py<gh_stars>1-10 # The models is stored in models.txt as # [serviceName1].[tableName1] # [serviceName1].[tableName2] # [serviceName2].[tableName1] from __future__ import print_function import os import sys import importlib import inspect from database import Base models_s...
en
0.649429
# The models is stored in models.txt as # [serviceName1].[tableName1] # [serviceName1].[tableName2] # [serviceName2].[tableName1] when services is None, import all models otherwise import models specified in services only
2.648012
3
generate-essay.py
chaaklau/appledaily-frequency
1
6621004
<filename>generate-essay.py import pandas as pd essay_cantonese = pd.read_csv( "source/essay-cantonese.txt", header=None, names=["char", "freq"], sep="\t", ) found = pd.read_csv( "output/found.tsv", header=None, names=["char", "freq"], sep="\t", ) file = open("output/essay-new.txt", "w...
<filename>generate-essay.py import pandas as pd essay_cantonese = pd.read_csv( "source/essay-cantonese.txt", header=None, names=["char", "freq"], sep="\t", ) found = pd.read_csv( "output/found.tsv", header=None, names=["char", "freq"], sep="\t", ) file = open("output/essay-new.txt", "w...
en
0.764305
# All words from essay_cantonese will be kept.
3.191111
3
src/roi/collection.py
BeastyBlacksmith/pyama
1
6621005
<reponame>BeastyBlacksmith/pyama<gh_stars>1-10 from threading import RLock from .base import Roi from ..listener import Listeners class RoiCollection: IDX_TYPE = 0 IDX_VERSION = 1 def __init__(self, key=None, type_=None, version=None, parameters=None, name=None, color=None, stroke_width=...
from threading import RLock from .base import Roi from ..listener import Listeners class RoiCollection: IDX_TYPE = 0 IDX_VERSION = 1 def __init__(self, key=None, type_=None, version=None, parameters=None, name=None, color=None, stroke_width=None): if key is None and isinstance(ty...
none
1
2.44981
2
psana/psana/peakFinder/examples/ex03-localextrema.py
JBlaschke/lcls2
16
6621006
#!/usr/bin/env python """ test of psalg_ext.local_minimums, local_maximums, threshold_maximums, local_maximums_rank1_cross """ #---------- import sys import psalg_ext as algos import numpy as np #---------- def test01(tname='1', NUMBER_OF_EVENTS=5, DO_PRINT=True) : print('local extrema : %s' % ('minimums' if tnam...
#!/usr/bin/env python """ test of psalg_ext.local_minimums, local_maximums, threshold_maximums, local_maximums_rank1_cross """ #---------- import sys import psalg_ext as algos import numpy as np #---------- def test01(tname='1', NUMBER_OF_EVENTS=5, DO_PRINT=True) : print('local extrema : %s' % ('minimums' if tnam...
pt
0.191628
#!/usr/bin/env python test of psalg_ext.local_minimums, local_maximums, threshold_maximums, local_maximums_rank1_cross #---------- #---------- #, sleep #---------- #---------- #ave, rms = img1.mean(), img1.std() #amin, amax = ave-1*rms, ave+5*rms #imsh1,cbar1=\ #imsh2,cbar2=\ #---------- #---------- #---------- #------...
2.299759
2
montlake/utils/utils.py
sjkoelle/montlake
8
6621007
<reponame>sjkoelle/montlake # AUTOGENERATED! DO NOT EDIT! File to edit: nbs/utils.utils.ipynb (unless otherwise specified). __all__ = ['get_index_matching', 'get_234_indices', 'get_atoms4_full', 'get_atoms3_full', 'data_stream_custom_range', 'get_cosines', 'cosine_similarity'] # Cell import numpy as np fro...
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/utils.utils.ipynb (unless otherwise specified). __all__ = ['get_index_matching', 'get_234_indices', 'get_atoms4_full', 'get_atoms3_full', 'data_stream_custom_range', 'get_cosines', 'cosine_similarity'] # Cell import numpy as np from einops import rearrange d...
en
0.431901
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/utils.utils.ipynb (unless otherwise specified). # Cell # combos[c][[0,2,1,3]], #print(p) Get indices in dictionary of each functions set ordered by order234 #print('here') # Cell # def get_cosines(dg): # n = dg.shape[0] # p = dg.shape[1] # d = dg.shape[2] # ...
1.942297
2
src/api/futures.py
newlyedward/datascinece
2
6621008
# -*- coding: utf-8 -*- import pandas as pd from datetime import datetime from src.api import conn from src.util import connect_mongo from log import LogHandler log = LogHandler('api.log') def get_dominant(code, start_date=None, end_date=None): """ 获取某一期货品种一段时间的主力合约列表。合约首次上市时,以当日收盘同品种持仓量最大者作为从第二个交易日开始的主力合约...
# -*- coding: utf-8 -*- import pandas as pd from datetime import datetime from src.api import conn from src.util import connect_mongo from log import LogHandler log = LogHandler('api.log') def get_dominant(code, start_date=None, end_date=None): """ 获取某一期货品种一段时间的主力合约列表。合约首次上市时,以当日收盘同品种持仓量最大者作为从第二个交易日开始的主力合约...
zh
0.71366
# -*- coding: utf-8 -*- 获取某一期货品种一段时间的主力合约列表。合约首次上市时,以当日收盘同品种持仓量最大者作为从第二个交易日开始的主力合约。 当同品种其他合约持仓量在收盘后超过当前主力合约时,从第二个交易日开始进行主力合约的切换。日内不会进行主力合约的切换。 :param code: 期货合约品种,例如沪深300股指期货为'IF' :param start_date: datetime.datetime 开始日期,默认为期货品种最早上市日期后一交易日 :param end_date: ...
2.450505
2
accelerator/tests/test_application_answer.py
masschallenge/django-accelerator
6
6621009
<reponame>masschallenge/django-accelerator # MIT License # Copyright (c) 2017 MassChallenge, Inc. from __future__ import unicode_literals from django.test import TestCase from accelerator.tests.factories import ApplicationAnswerFactory class TestApplicationAnswer(TestCase): def test_str(self): applica...
# MIT License # Copyright (c) 2017 MassChallenge, Inc. from __future__ import unicode_literals from django.test import TestCase from accelerator.tests.factories import ApplicationAnswerFactory class TestApplicationAnswer(TestCase): def test_str(self): application_answer = ApplicationAnswerFactory() ...
en
0.640174
# MIT License # Copyright (c) 2017 MassChallenge, Inc.
2.436134
2
src/dataclass_bakery/generators/generators_exceptions.py
miguelFLG13/dataclass-bakery
1
6621010
class TypeNotAllow(Exception): def __init__(self, *args, **kwargs): super().__init__("TypeNotAllow: Creating a dataclass object")
class TypeNotAllow(Exception): def __init__(self, *args, **kwargs): super().__init__("TypeNotAllow: Creating a dataclass object")
none
1
2.386627
2
Pipeline/run_dock6_to_nc.py
CCBatIIT/AlGDock
15
6621011
<gh_stars>10-100 job_block = 50 import argparse parser = argparse.ArgumentParser() parser.add_argument('--job_block', default=job_block, type=int, \ help='Number of dockings per job') parser.add_argument('--dry', action='store_true', default=False, \ help='Does not actually submit the job to the queue') args = p...
job_block = 50 import argparse parser = argparse.ArgumentParser() parser.add_argument('--job_block', default=job_block, type=int, \ help='Number of dockings per job') parser.add_argument('--dry', action='store_true', default=False, \ help='Does not actually submit the job to the queue') args = parser.parse_args(...
en
0.538521
# Find dock6_to_nc.py # Convert from mol2 to netcdf files
2.387426
2
leetcode/0-250/145-198. House Robber.py
palash24/algorithms-and-data-structures
23
6621012
# 198. House Robber class Solution(object): def rob(self, nums): l = len(nums) robs = [0] * (l + 2) for i in range(l): robs[i + 2] = max(robs[i] + nums[i], robs[i + 1]) return robs[l + 1]
# 198. House Robber class Solution(object): def rob(self, nums): l = len(nums) robs = [0] * (l + 2) for i in range(l): robs[i + 2] = max(robs[i] + nums[i], robs[i + 1]) return robs[l + 1]
en
0.688933
# 198. House Robber
2.890374
3
2020-03-26-Python-Object-Model/examples/set-name.py
s3rvac/talks
2
6621013
<reponame>s3rvac/talks<filename>2020-03-26-Python-Object-Model/examples/set-name.py # An example of using __set_name__. It can be used for descriptors to # automatically detect the name of the attribute they have been assigned to. # Available since Python 3.6. class X: def __set_name__(self, owner, name): ...
# An example of using __set_name__. It can be used for descriptors to # automatically detect the name of the attribute they have been assigned to. # Available since Python 3.6. class X: def __set_name__(self, owner, name): print(f'owner: {owner}, name: {name!r}') class A: a = X() # owner: <class '__ma...
en
0.681022
# An example of using __set_name__. It can be used for descriptors to # automatically detect the name of the attribute they have been assigned to. # Available since Python 3.6. # owner: <class '__main__.A'>, name: 'a' # owner: <class '__main__.A'>, name: 'b' # owner: <class '__main__.A'>, name: 'c'
3.605058
4
Chromatography_Simulator.py
Tocha4/-Displacement--Chromatography
2
6621014
<filename>Chromatography_Simulator.py from PyQt5.QtWidgets import QApplication from Graphs.fig_01 import PlotCanvas from Graphs.graphChromaCanvas import PlotCanvas_Chrom from Graphs.Popup_ai import popup from fa_02 import App import sys import numpy as np import seaborn as sns; sns.set() class main(App): de...
<filename>Chromatography_Simulator.py from PyQt5.QtWidgets import QApplication from Graphs.fig_01 import PlotCanvas from Graphs.graphChromaCanvas import PlotCanvas_Chrom from Graphs.Popup_ai import popup from fa_02 import App import sys import numpy as np import seaborn as sns; sns.set() class main(App): de...
en
0.798035
# lets test some stuff
2.649259
3
setup.py
jjnp/traefik-eval
0
6621015
<filename>setup.py import os import setuptools try: with open("README.md", "r") as fh: long_description = fh.read() except FileNotFoundError: long_description = '' try: with open("requirements-dev.txt", "r") as fh: tests_require = [line for line in fh.read().split(os.linesep) if line] exc...
<filename>setup.py import os import setuptools try: with open("README.md", "r") as fh: long_description = fh.read() except FileNotFoundError: long_description = '' try: with open("requirements-dev.txt", "r") as fh: tests_require = [line for line in fh.read().split(os.linesep) if line] exc...
none
1
1.737867
2
OpenCV/Section2-Advanced/bitwise.py
CChCheChen/OpenCV-Course
0
6621016
import cv2 as cv import numpy as np blank = np.zeros((400,400), dtype='uint8') rectangle = cv.rectangle(blank.copy(), (30,30), (370,370), 255, -1) circle = cv.circle(blank.copy(), (200,200), 200, 255, -1) cv.imshow('rectangle', rectangle) cv.imshow('circle', circle) # Bitwise AND --> intersecting regions bitwise_an...
import cv2 as cv import numpy as np blank = np.zeros((400,400), dtype='uint8') rectangle = cv.rectangle(blank.copy(), (30,30), (370,370), 255, -1) circle = cv.circle(blank.copy(), (200,200), 200, 255, -1) cv.imshow('rectangle', rectangle) cv.imshow('circle', circle) # Bitwise AND --> intersecting regions bitwise_an...
en
0.718984
# Bitwise AND --> intersecting regions # Bitwise OR --> non-intersecting and intersecting regions # Bitwise XOR --> non-intersecting regions # Bitwise NOT
3.095028
3
include/HydrusNATPunch.py
antonpaquin/hydrus
0
6621017
<filename>include/HydrusNATPunch.py import HydrusConstants as HC import HydrusData import HydrusExceptions import HydrusText import os import shlex import socket import subprocess import threading import traceback # new stuff starts here if HC.PLATFORM_LINUX: upnpc_path = os.path.join( HC.BIN_DIR, 'upnpc_lin...
<filename>include/HydrusNATPunch.py import HydrusConstants as HC import HydrusData import HydrusExceptions import HydrusText import os import shlex import socket import subprocess import threading import traceback # new stuff starts here if HC.PLATFORM_LINUX: upnpc_path = os.path.join( HC.BIN_DIR, 'upnpc_lin...
en
0.33493
# new stuff starts here ExternalIPAddress = ip 0 UDP 65533->192.168.0.197:65533 'Skype UDP at 192.168.0.197:65533 (2665)' '' 0
1.976149
2
binary_image_processing.py
Geo-Joy/opencv-basic-hacks
0
6621018
import cv2 import numpy as np ### THRESHOLDING # reading the image as greyscale org_img = cv2.imread("data/images/threshold.png", cv2.IMREAD_GRAYSCALE) threshold = 0 # set value above which thresholding works maxValue = 255 # min value below which thresholding should be applied #retval, dst = cv.threshol...
import cv2 import numpy as np ### THRESHOLDING # reading the image as greyscale org_img = cv2.imread("data/images/threshold.png", cv2.IMREAD_GRAYSCALE) threshold = 0 # set value above which thresholding works maxValue = 255 # min value below which thresholding should be applied #retval, dst = cv.threshol...
en
0.761203
### THRESHOLDING # reading the image as greyscale # set value above which thresholding works # min value below which thresholding should be applied #retval, dst = cv.threshold(src, thresh, maxval, type[, dst]) # display the images # write the new image to disk ### Dilation # We create the kernel/structuring element tha...
3.751095
4
src_gpu/preprocessing/breast_detection/crop_main_file.py
rogov-dvp/medical-imaging-matching
1
6621019
#What packages were installed: # # python 3.9.7 # pip 21.2.4 # tensorflow 2.8.0 # opencv # https://tensorflow-object-detection-api-tutorial.readthedocs.io/en/latest/install.html # (CPU): # - download protobuf version: https://github.com/protocolbuffers/protobuf/releases/tag/v3.19.4 # - Add to environment path ...
#What packages were installed: # # python 3.9.7 # pip 21.2.4 # tensorflow 2.8.0 # opencv # https://tensorflow-object-detection-api-tutorial.readthedocs.io/en/latest/install.html # (CPU): # - download protobuf version: https://github.com/protocolbuffers/protobuf/releases/tag/v3.19.4 # - Add to environment path ...
en
0.580216
#What packages were installed: # # python 3.9.7 # pip 21.2.4 # tensorflow 2.8.0 # opencv # https://tensorflow-object-detection-api-tutorial.readthedocs.io/en/latest/install.html # (CPU): # - download protobuf version: https://github.com/protocolbuffers/protobuf/releases/tag/v3.19.4 # - Add to environment path <...
2.279964
2
minigrid_and_pd_experiments/base.py
allenai/advisor
5
6621020
import abc import math import os from typing import ( Optional, List, Any, Dict, cast, Sequence, Callable, Union, NamedTuple, ) import gym import torch from gym_minigrid.minigrid import Lava, WorldObj, Wall from torch import nn, optim from torch.optim.lr_scheduler import LambdaLR f...
import abc import math import os from typing import ( Optional, List, Any, Dict, cast, Sequence, Callable, Union, NamedTuple, ) import gym import torch from gym_minigrid.minigrid import Lava, WorldObj, Wall from torch import nn, optim from torch.optim.lr_scheduler import LambdaLR f...
en
0.480996
# Default MiniGrid values # Default Poisoned Doors values # Training params # if torch.cuda.is_available() else 1 # Hyperparameters # Auxiliary head parameters # Logging / saving Base experiment. All information needed about the underlying task. # Returns Dictionary of useful information: ...
1.544206
2
services/service-api/lib/wikipedia.py
elaisasearch/elaisa.org
2
6621021
""" Handles the Wikipedia data for the user's search value. """ import wikipedia def getWikiEntry(terms: list, language: str) -> dict: """ Takes the user's search term and chosen language and returns the wikipedia article information. :terms: List :language: String :return: Dictionary """ ...
""" Handles the Wikipedia data for the user's search value. """ import wikipedia def getWikiEntry(terms: list, language: str) -> dict: """ Takes the user's search term and chosen language and returns the wikipedia article information. :terms: List :language: String :return: Dictionary """ ...
en
0.577977
Handles the Wikipedia data for the user's search value. Takes the user's search term and chosen language and returns the wikipedia article information. :terms: List :language: String :return: Dictionary
3.758421
4
python/qilinguist/worktree.py
vbarbaresi/qibuild
0
6621022
# Copyright (c) 2012-2018 SoftBank Robotics. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the COPYING file. import os from qisys import ui import qisys.worktree import qisys.qixml class LinguistWorkTree(qisys.worktree.WorkTreeObserver): def __init__(se...
# Copyright (c) 2012-2018 SoftBank Robotics. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the COPYING file. import os from qisys import ui import qisys.worktree import qisys.qixml class LinguistWorkTree(qisys.worktree.WorkTreeObserver): def __init__(se...
en
0.714176
# Copyright (c) 2012-2018 SoftBank Robotics. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the COPYING file. \ Found two projects with the same name ({0}) In: * {1} * {2} # pylint: disable=unused-argument # try deprecated name too \ Unknow translation framework...
2.26642
2
fiery/models/__init__.py
sty61010/fiery
0
6621023
from importlib import import_module from fiery.layers.bev_self_attention import BEVSelfAttention from fiery.models.encoder import ImageAttention from fiery.models.head_wrappers.Anchor3DHeadWrapper import Anchor3DHeadWrapper from fiery.models.head_wrappers.CenterHeadWrapper import CenterHeadWrapper def import_obj(cfg...
from importlib import import_module from fiery.layers.bev_self_attention import BEVSelfAttention from fiery.models.encoder import ImageAttention from fiery.models.head_wrappers.Anchor3DHeadWrapper import Anchor3DHeadWrapper from fiery.models.head_wrappers.CenterHeadWrapper import CenterHeadWrapper def import_obj(cfg...
none
1
2.158286
2
DaPy/methods/evaluator.py
huihui7987/DaPy
552
6621024
from DaPy.core import Matrix, SeriesSet, Series from DaPy.core import LogInfo, LogWarn, LogErr, is_seq from DaPy.matlib import zeros, mean from math import sqrt def ConfuMat(Y, y_, labels): '''calculate confution Matrix''' labels = sorted(set(Y) | set(y_)) confu = zeros((len(labels) + 1, len(labels) + 1)...
from DaPy.core import Matrix, SeriesSet, Series from DaPy.core import LogInfo, LogWarn, LogErr, is_seq from DaPy.matlib import zeros, mean from math import sqrt def ConfuMat(Y, y_, labels): '''calculate confution Matrix''' labels = sorted(set(Y) | set(y_)) confu = zeros((len(labels) + 1, len(labels) + 1)...
en
0.606136
calculate confution Matrix performace score to evalulate a regressor
2.224506
2
planner.py
haeinous/a-relational-db
0
6621025
#!/usr/bin/python3 """ Implement a Scan node that yields a single record each time its next method is called, as well as a Selection node initialized with a predicate function (one which returns true or false), which yields the next record for which the predicate function returns true whenever its own next method is ...
#!/usr/bin/python3 """ Implement a Scan node that yields a single record each time its next method is called, as well as a Selection node initialized with a predicate function (one which returns true or false), which yields the next record for which the predicate function returns true whenever its own next method is ...
en
0.935807
#!/usr/bin/python3 Implement a Scan node that yields a single record each time its next method is called, as well as a Selection node initialized with a predicate function (one which returns true or false), which yields the next record for which the predicate function returns true whenever its own next method is calle...
3.218206
3
factories/go_ethereum_osx.py
vaporyproject/ethereum-buildbot
35
6621026
#!/usr/bin/env python # -*- coding: utf-8 -*- import factory reload(factory) from factory import * def osx_go_factory(branch='develop', isPullRequest=False): factory = BuildFactory() for step in [ Git( haltOnFailure=True, logEnviron=False, repourl='https://github....
#!/usr/bin/env python # -*- coding: utf-8 -*- import factory reload(factory) from factory import * def osx_go_factory(branch='develop', isPullRequest=False): factory = BuildFactory() for step in [ Git( haltOnFailure=True, logEnviron=False, repourl='https://github....
en
0.352855
#!/usr/bin/env python # -*- coding: utf-8 -*-
2.004995
2
mars_scrape.py
Megaexoplanet/Web_scraping_challenge
0
6621027
<gh_stars>0 from splinter import Browser from bs4 import BeautifulSoup as bs import pandas as pd import re import time def scrape(): browser = Browser('chrome',executable_path='chromedriver', headless=True) news_title,news_p = mars_news(browser) mars_data = { 'mars_title': news_title, ...
from splinter import Browser from bs4 import BeautifulSoup as bs import pandas as pd import re import time def scrape(): browser = Browser('chrome',executable_path='chromedriver', headless=True) news_title,news_p = mars_news(browser) mars_data = { 'mars_title': news_title, 'mars_p': n...
en
0.329858
# # Visit the NASA Mars News Site # JPL Space Images Featured Image # Mars Weather # Mars Hemispheres # Mars Facts
3.042222
3
scrapybot/urlf/__init__.py
roadt/scrapybot
0
6621028
import re from functools import partial def scheme(url, **kwargs): schemes = 'scheme' in kwargs and kwargs['scheme'].split(',') or ['http','https'] return any(map(lambda scheme: url.startswith(scheme+'://'), schemes)) def regex(url, **kwargs): exprs = 'regex' in kwargs and kwargs['regex'].split(',...
import re from functools import partial def scheme(url, **kwargs): schemes = 'scheme' in kwargs and kwargs['scheme'].split(',') or ['http','https'] return any(map(lambda scheme: url.startswith(scheme+'://'), schemes)) def regex(url, **kwargs): exprs = 'regex' in kwargs and kwargs['regex'].split(',...
none
1
2.953453
3
src/domainClient/api/demographics_api.py
diabolical-ninja/smart-property-search
5
6621029
<filename>src/domainClient/api/demographics_api.py<gh_stars>1-10 # coding: utf-8 """ Domain Group API V1 Provides public access to Domain's microservices # noqa: E501 OpenAPI spec version: v1 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_...
<filename>src/domainClient/api/demographics_api.py<gh_stars>1-10 # coding: utf-8 """ Domain Group API V1 Provides public access to Domain's microservices # noqa: E501 OpenAPI spec version: v1 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_...
en
0.588243
# coding: utf-8 Domain Group API V1 Provides public access to Domain's microservices # noqa: E501 OpenAPI spec version: v1 Generated by: https://github.com/swagger-api/swagger-codegen.git # noqa: F401 # python 2 and python 3 compatibility library NOTE: This class is auto generated by the swagger cod...
2.533288
3
main/models.py
r4bc1/monaco_2018_racing
0
6621030
from peewee import * db = SqliteDatabase("report.db") class Racer(Model): position = IntegerField() name = CharField() team = CharField() time = CharField() driver_id = CharField() class Meta: database = db
from peewee import * db = SqliteDatabase("report.db") class Racer(Model): position = IntegerField() name = CharField() team = CharField() time = CharField() driver_id = CharField() class Meta: database = db
none
1
2.443696
2
Estrutura_Decisao/pay_your_taxes.py
M3nin0/supreme-broccoli
0
6621031
<reponame>M3nin0/supreme-broccoli valor = int(input("Insira o valor da hora: ")) hora = int(input("Insira a quntidade de horas trabalhadas: ")) sb = valor * hora if sb <= 900: inss = sb * (10 / 100) fgts = sb * (11 / 100) desc = inss + fgts print ("O valor total dos descontos é:",desc,"\nE seu salario liquido é:",...
valor = int(input("Insira o valor da hora: ")) hora = int(input("Insira a quntidade de horas trabalhadas: ")) sb = valor * hora if sb <= 900: inss = sb * (10 / 100) fgts = sb * (11 / 100) desc = inss + fgts print ("O valor total dos descontos é:",desc,"\nE seu salario liquido é:",sb - desc) elif sb > 900 and sb <...
none
1
3.882248
4
pkg_tf_micromouse/scripts/obstacle.py
SuyashVerma2311/micromouse_maze_solver
0
6621032
<filename>pkg_tf_micromouse/scripts/obstacle.py import rospy from sensor_msgs.msg import LaserScan from geometry_msgs.msg import Twist from nav_msgs.msg import Odometry from tf import transformations import numpy as np class Obstacle(object): def __init__(self, delta_err=3): self.sub = rospy.Subscriber('/m...
<filename>pkg_tf_micromouse/scripts/obstacle.py import rospy from sensor_msgs.msg import LaserScan from geometry_msgs.msg import Twist from nav_msgs.msg import Odometry from tf import transformations import numpy as np class Obstacle(object): def __init__(self, delta_err=3): self.sub = rospy.Subscriber('/m...
en
0.393115
# left-center-right # print("size: ", len(msg.ranges)) # position # yaw
2.240153
2
scripts/email-anonymizer.py
bokysan/docker-postfix
271
6621033
<filename>scripts/email-anonymizer.py<gh_stars>100-1000 #!/usr/bin/env python3 """ Filter to anonyimize email addresses. It reads input line by line, finds all emails in the input and masks them using given filter. Big thanks to [<NAME>](https://github.com/sdelrio) for the concept and the idea, although not a lot of...
<filename>scripts/email-anonymizer.py<gh_stars>100-1000 #!/usr/bin/env python3 """ Filter to anonyimize email addresses. It reads input line by line, finds all emails in the input and masks them using given filter. Big thanks to [<NAME>](https://github.com/sdelrio) for the concept and the idea, although not a lot of...
en
0.847476
#!/usr/bin/env python3 Filter to anonyimize email addresses. It reads input line by line, finds all emails in the input and masks them using given filter. Big thanks to [<NAME>](https://github.com/sdelrio) for the concept and the idea, although not a lot of the code went into this commit in the end. # BIG FAT NOTICE o...
3.38834
3
rascil/__init__.py
SKA-ScienceDataProcessor/rascil
7
6621034
from . import data_models from . import processing_components from . import workflows from .processing_components.util.installation_checks import check_data_directory from astropy.utils import iers, data check_data_directory() # iers.conf.auto_max_age = None iers.conf.remote_timeout = 100.0 data.conf.download_cache...
from . import data_models from . import processing_components from . import workflows from .processing_components.util.installation_checks import check_data_directory from astropy.utils import iers, data check_data_directory() # iers.conf.auto_max_age = None iers.conf.remote_timeout = 100.0 data.conf.download_cache...
it
0.542374
# iers.conf.auto_max_age = None
1.239912
1
schema/queries.py
benyakirten/a-weeks-worth-backend
0
6621035
<filename>schema/queries.py import graphene from graphene_django import DjangoListField from graphql_jwt.decorators import login_required, superuser_required from aww.models import Individual, Group, Recipe from .types import ( RecipeStepType, RecipeIngredientType, RecipeType, GroupShoppingItemType, ...
<filename>schema/queries.py import graphene from graphene_django import DjangoListField from graphql_jwt.decorators import login_required, superuser_required from aww.models import Individual, Group, Recipe from .types import ( RecipeStepType, RecipeIngredientType, RecipeType, GroupShoppingItemType, ...
en
0.962366
# This same function is better done by the MeQuery. # That said, this is a function for a superuser to look for an individual # No idea why you'd ever need this query, given the MeQuery # But might as well get some experience
2.588155
3
vision/api/label/snippets_test.py
baditaflorin/python-docs-samples
1
6621036
<reponame>baditaflorin/python-docs-samples #!/usr/bin/env python # Copyright 2016 Google, Inc # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2...
#!/usr/bin/env python # Copyright 2016 Google, Inc # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
en
0.830997
#!/usr/bin/env python # Copyright 2016 Google, Inc # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
2.281902
2
gen_sql_handler.py
freewillfx-azenqos/azm_db_merge
5
6621037
<gh_stars>1-10 ''' module to handle merging (importing) of (azqdata.db from azq .azm files) sqlite3 dump lines into a PostgreSQL and Microsoft SQL Server db. Copyright: Copyright (C) 2016 Freewill FX Co., Ltd. All rights reserved. ''' from debug_helpers import dprint import azm_db_constants from subprocess import ca...
''' module to handle merging (importing) of (azqdata.db from azq .azm files) sqlite3 dump lines into a PostgreSQL and Microsoft SQL Server db. Copyright: Copyright (C) 2016 Freewill FX Co., Ltd. All rights reserved. ''' from debug_helpers import dprint import azm_db_constants from subprocess import call import os im...
en
0.627925
module to handle merging (importing) of (azqdata.db from azq .azm files) sqlite3 dump lines into a PostgreSQL and Microsoft SQL Server db. Copyright: Copyright (C) 2016 Freewill FX Co., Ltd. All rights reserved. # global vars # would be set in --unmerge mode now we already use 'autocommit = True' as recommended by MSD...
1.976641
2
ui/pypesvds/controllers/project.py
onfire73/pypeskg
117
6621038
import logging import traceback import json from pylons import request, response, session, tmpl_context as c from pylons import app_globals from pylons.controllers.util import abort # added for auth from authkit.authorize.pylons_adaptors import authorize from authkit.permissions import RemoteUser, ValidAuthKitUser, Us...
import logging import traceback import json from pylons import request, response, session, tmpl_context as c from pylons import app_globals from pylons.controllers.util import abort # added for auth from authkit.authorize.pylons_adaptors import authorize from authkit.permissions import RemoteUser, ValidAuthKitUser, Us...
en
0.56645
# added for auth REST Controller styled on the Atom Publishing Protocol # To properly map this controller, ensure your config/routing.py # file has a resource setup: # map.resource('project', 'project') #@authorize(ValidAuthKitUser()) GET /project: All items in the collection # url('project') POST /project: Create ...
2.224518
2
photogrid.py
stnc-python/Tasvirci
0
6621039
#!/usr/bin/env python # -*- coding: utf-8 -*- # Tasvirci by OsmanDE # github.com/OsmanDE/Tasvirci from photogrid_dialog import Ui_GridDialog from gridsetup_dialog import Ui_GridSetupDialog from PyQt5.QtCore import Qt, QObject, pyqtSignal, QRect, QPoint from PyQt5.QtGui import QPixmap, QPainter, QImageReader, QPen from...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Tasvirci by OsmanDE # github.com/OsmanDE/Tasvirci from photogrid_dialog import Ui_GridDialog from gridsetup_dialog import Ui_GridSetupDialog from PyQt5.QtCore import Qt, QObject, pyqtSignal, QRect, QPoint from PyQt5.QtGui import QPixmap, QPainter, QImageReader, QPen from...
tr
0.994764
#!/usr/bin/env python # -*- coding: utf-8 -*- # Tasvirci by OsmanDE # github.com/OsmanDE/Tasvirci Resim koymak için bir resim thumbnaili seç. Seçtiğin fotoğrafı koymak için boş kutulardan birine tıkla. Eğer gridi daha farklı resimlerden oluşturmak istiyorsan fotoğraf ekleme kısmını seç. Yeni bir resim seçerek eski re...
1.967031
2
nmt/data/tools/fuse_bpe_all.py
xjz92/Attach-Dictionary
1
6621040
<reponame>xjz92/Attach-Dictionary<filename>nmt/data/tools/fuse_bpe_all.py<gh_stars>1-10 def load_dictionary(ent_path,def_path): dicti={} for ents, defs in zip(open(ent_path),open(def_path)): entry=ents.strip('\n') defini=defs.strip('\n') #print(len(defini.split())) if(entry!=defi...
def load_dictionary(ent_path,def_path): dicti={} for ents, defs in zip(open(ent_path),open(def_path)): entry=ents.strip('\n') defini=defs.strip('\n') #print(len(defini.split())) if(entry!=defini): dicti[entry]=defini sorted_items= sorted(dicti.items(), key=lambda ...
ru
0.260892
#print(len(defini.split())) #print(len(out))
2.915988
3
rec_app/src/data.py
LukasSteffensen/movielens-imdb-exploration
30
6621041
<reponame>LukasSteffensen/movielens-imdb-exploration import pandas as pd import datetime, time import os import random import numpy as np import scipy.sparse as sp import json from IPython.display import Image import base64 from imdbpie import Imdb import requests DATA_DIR = "../../movielens-imdb-exploration/data" de...
import pandas as pd import datetime, time import os import random import numpy as np import scipy.sparse as sp import json from IPython.display import Image import base64 from imdbpie import Imdb import requests DATA_DIR = "../../movielens-imdb-exploration/data" def string2ts(string, fmt="%Y-%m-%d %H:%M:%S"): dt ...
en
0.811003
# MOVIES # TODO: just temporary, later remove # RATINGS # USERS # TODO: just temporary, later remove #additional_rows = ["user_zipcode"] #df_users = df_users.drop(additional_rows, axis=1) # ALL # Creating UID, IID, FID # movies # users # shape [n_users, n_user_features] # user initial input that will be given to him to...
2.731553
3
myworkspace/translate_tutorial/cnn_test.py
haochen12/dpPython
0
6621042
<filename>myworkspace/translate_tutorial/cnn_test.py from __future__ import absolute_import, division, print_function, unicode_literals import tensorflow as tf from tensorflow.keras import datasets, models from tensorflow.keras.layers import Dense, Conv2D, MaxPooling2D, Dropout, Flatten from tensorflow.keras.utils im...
<filename>myworkspace/translate_tutorial/cnn_test.py from __future__ import absolute_import, division, print_function, unicode_literals import tensorflow as tf from tensorflow.keras import datasets, models from tensorflow.keras.layers import Dense, Conv2D, MaxPooling2D, Dropout, Flatten from tensorflow.keras.utils im...
none
1
3.107594
3
src/pynn/bin/decode_g2p.py
enesyugan/yapay-nn
0
6621043
#!/usr/bin/env python3 # encoding: utf-8 # Copyright 2019 <NAME> # Licensed under the Apache License, Version 2.0 (the "License") import time import argparse import torch from pynn.util import load_object from pynn.decoder.s2s import beam_search from pynn.util.text import load_dict, write_hypo parser = argparse.A...
#!/usr/bin/env python3 # encoding: utf-8 # Copyright 2019 <NAME> # Licensed under the Apache License, Version 2.0 (the "License") import time import argparse import torch from pynn.util import load_object from pynn.decoder.s2s import beam_search from pynn.util.text import load_dict, write_hypo parser = argparse.A...
en
0.712648
#!/usr/bin/env python3 # encoding: utf-8 # Copyright 2019 <NAME> # Licensed under the Apache License, Version 2.0 (the "License") #seq = [src_dic[ch] for ch in word]
2.157879
2
utils/util.py
mchirico/gmail
1
6621044
<reponame>mchirico/gmail import pickle from os import path def pickle_it(file, obj): with open(file, 'wb') as f: pickle.dump(obj, f) def unpickle_it(file): with open(file, 'rb') as f: return pickle.load(f) def findFile(file="bigquery.json"): if path.exists("credentials/{}".format(file)...
import pickle from os import path def pickle_it(file, obj): with open(file, 'wb') as f: pickle.dump(obj, f) def unpickle_it(file): with open(file, 'rb') as f: return pickle.load(f) def findFile(file="bigquery.json"): if path.exists("credentials/{}".format(file)): return "creden...
none
1
2.883862
3
regionalSwordFernDieOff/generateDirectories.py
paul-shannon/annotatedMap
0
6621045
import json import os import yaml sites = json.load(open('v4.js')) for i in range(len(sites)): directoryName = "site.%04d" % i if(not os.path.exists(directoryName)): os.mkdir(directoryName) print(" %s exists? %s" % (directoryName, os.path.exists(directoryName))) site = sites[i] site["firstReporte...
import json import os import yaml sites = json.load(open('v4.js')) for i in range(len(sites)): directoryName = "site.%04d" % i if(not os.path.exists(directoryName)): os.mkdir(directoryName) print(" %s exists? %s" % (directoryName, os.path.exists(directoryName))) site = sites[i] site["firstReporte...
en
0.484802
# site.yaml # firstReported: 2013-10-01 # lastUpdate: 2019-03-01 # contact: <NAME> # radius: 100 # area: 10 # severity: 10 # notesFile: notes.html # title: Seward Park Ground Zero # lat: 47.555474 # lon: -122.248945 # firstReported: 2013-10-01 # lastUpdate: 2019-03-01 # contact: <NAME> # radius: 100 # area: 10 # s...
2.475645
2
japanese2phoneme/normalize.py
iory/japanese2phoneme
0
6621046
def normalize_japanese_text(line: str) -> str: for char in [u"(", u")", u" ", u".", u"?", u"「", u"」", u"[", u"]", u"@W", u"@S", u"<", u">", u" ", u"。"]: line = line.replace(char, "") for char in [u"・", u"·"]: line = line.replace(char, " ") line = line.strip() return li...
def normalize_japanese_text(line: str) -> str: for char in [u"(", u")", u" ", u".", u"?", u"「", u"」", u"[", u"]", u"@W", u"@S", u"<", u">", u" ", u"。"]: line = line.replace(char, "") for char in [u"・", u"·"]: line = line.replace(char, " ") line = line.strip() return li...
none
1
3.402674
3
rel8/app.py
aucontraire/rel8
0
6621047
#!/usr/bin/env python3 """rel8 Flask app""" import binascii import csv import datetime from dateutil import relativedelta from flask import abort, flash, Flask, jsonify, render_template from flask import redirect, request, session, stream_with_context, url_for from flask_bcrypt import Bcrypt from flask_login import Log...
#!/usr/bin/env python3 """rel8 Flask app""" import binascii import csv import datetime from dateutil import relativedelta from flask import abort, flash, Flask, jsonify, render_template from flask import redirect, request, session, stream_with_context, url_for from flask_bcrypt import Bcrypt from flask_login import Log...
en
0.315342
#!/usr/bin/env python3 rel8 Flask app #TODO: keep?
1.97264
2
ape_starknet/__init__.py
ApeWorX/ape-starknet
0
6621048
from ape import plugins from ape.api.networks import LOCAL_NETWORK_NAME, NetworkAPI, create_network_type from ape.types import AddressType from ape_starknet._utils import NETWORKS, PLUGIN_NAME from ape_starknet.accounts import StarknetAccountContracts, StarknetKeyfileAccount from ape_starknet.config import StarknetCon...
from ape import plugins from ape.api.networks import LOCAL_NETWORK_NAME, NetworkAPI, create_network_type from ape.types import AddressType from ape_starknet._utils import NETWORKS, PLUGIN_NAME from ape_starknet.accounts import StarknetAccountContracts, StarknetKeyfileAccount from ape_starknet.config import StarknetCon...
en
0.97535
# NOTE: This works for development providers, as they get chain_id from themselves
2.01862
2
tests/test_mysql.py
dropbox/pytest-call-tracer
5
6621049
<filename>tests/test_mysql.py from __future__ import absolute_import import MySQLdb from unittest import TestCase class MySQLdbSampleTest(TestCase): def setUp(self): self.client = MySQLdb.connect() def test_simple(self): self.client.query('select 1') r = self.client.use_result() ...
<filename>tests/test_mysql.py from __future__ import absolute_import import MySQLdb from unittest import TestCase class MySQLdbSampleTest(TestCase): def setUp(self): self.client = MySQLdb.connect() def test_simple(self): self.client.query('select 1') r = self.client.use_result() ...
none
1
2.53408
3
vcdynhello.py
tjarrettveracode/veracode-dyn-hello-world
0
6621050
<gh_stars>0 import sys import argparse import logging import json import datetime import anticrlf from veracode_api_py import VeracodeAPI as vapi, Applications, Analyses, DynUtils DEFAULT_BUSINESS_CRITICALITY = 'HIGH' log = logging.getLogger(__name__) def setup_logger(): handler = logging.FileHandler('vcdynhell...
import sys import argparse import logging import json import datetime import anticrlf from veracode_api_py import VeracodeAPI as vapi, Applications, Analyses, DynUtils DEFAULT_BUSINESS_CRITICALITY = 'HIGH' log = logging.getLogger(__name__) def setup_logger(): handler = logging.FileHandler('vcdynhello.log', enco...
en
0.775462
#we get a datetime with timezone... # CHECK FOR CREDENTIALS EXPIRATION # check to see if already an application profile named the URL # create the application # check to see if we already have a dynamic analysis for this URL # configure the scan request # create the analysis # no JSON returned for create_analysis, need...
2.18794
2