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
desktop/core/src/desktop/lib/idbroker/client.py
yetsun/hue
5,079
6632751
# Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file ex...
# Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file ex...
en
0.856536
# Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file ex...
1.678793
2
solvent_classification/vectorize_data.py
rmrmg/SuzukiConditions
2
6632752
import argparse parser = argparse.ArgumentParser() parser.add_argument('--datafile', type=str, default='heteroaryl_suzuki.csv') parser.add_argument('--mol2vec_model', default='model_300dim.pkl') args= parser.parse_args() import numpy as np from mol2vec.features import mol2alt_sentence, sentences2vec from gensim.models...
import argparse parser = argparse.ArgumentParser() parser.add_argument('--datafile', type=str, default='heteroaryl_suzuki.csv') parser.add_argument('--mol2vec_model', default='model_300dim.pkl') args= parser.parse_args() import numpy as np from mol2vec.features import mol2alt_sentence, sentences2vec from gensim.models...
en
0.305895
#1. COMMON FILES #aga_solvents = pd.read_csv('../other/aga_smiles_solv.csv', sep=';')#DEL? #aga_bases = pd.read_csv('../other/aga_smiles_base.csv', sep=';')#DEL? #ligands = pd.read_csv('../other/suzuki_ligandy.csv', sep=';')#DEL? #2. VECTORIZATIONS #2a. Mol2Vec #s = '.'.join(line)#list(s)[0] #2b. RdKIT #if len(s)>1: ra...
2.422082
2
sscanss/ui/commands/control.py
StephenNneji/SScanSS-2
0
6632753
<reponame>StephenNneji/SScanSS-2 from PyQt5 import QtWidgets from sscanss.core.util import CommandID, toggleActionInGroup, Attributes class LockJoint(QtWidgets.QUndoCommand): """Sets lock state of specified joint :param positioner_name: name of positioner :type positioner_name: str :param index: join...
from PyQt5 import QtWidgets from sscanss.core.util import CommandID, toggleActionInGroup, Attributes class LockJoint(QtWidgets.QUndoCommand): """Sets lock state of specified joint :param positioner_name: name of positioner :type positioner_name: str :param index: joint index :type index: int ...
en
0.731049
Sets lock state of specified joint :param positioner_name: name of positioner :type positioner_name: str :param index: joint index :type index: int :param value: indicates if joint is locked :type value: bool :param presenter: Mainwindow presenter instance :type presenter: MainWindowPre...
2.552131
3
epic/utils/cell_migration.py
AlphonsG/EPIC-BBox-Cell-Tracking
0
6632754
<reponame>AlphonsG/EPIC-BBox-Cell-Tracking<gh_stars>0 # Copyright (c) 2021 <NAME> # # This software is released under the MIT License. # https://opensource.org/licenses/MIT from epic.utils.misc import avg_bbox_length import numpy as np def bnd_ldg_es(det, leading_edges): top_edge, bottom_edge = leading_edges ...
# Copyright (c) 2021 <NAME> # # This software is released under the MIT License. # https://opensource.org/licenses/MIT from epic.utils.misc import avg_bbox_length import numpy as np def bnd_ldg_es(det, leading_edges): top_edge, bottom_edge = leading_edges return det.centre[1] > bottom_edge or det.centre[1] ...
en
0.853077
# Copyright (c) 2021 <NAME> # # This software is released under the MIT License. # https://opensource.org/licenses/MIT
1.832749
2
app/controllers/add_dataset.py
rodrigoasrodrigues/CS598-T7
0
6632755
import os import uuid import json import hashlib from flask import render_template, request, redirect, send_from_directory from app import app from app import db from app.controllers.env_configs import EnvConf from app.models.tables import (DatasetFile, LabelFile, Word2VecModel) from threading import Thread from app.c...
import os import uuid import json import hashlib from flask import render_template, request, redirect, send_from_directory from app import app from app import db from app.controllers.env_configs import EnvConf from app.models.tables import (DatasetFile, LabelFile, Word2VecModel) from threading import Thread from app.c...
en
0.746099
# counts positive and total then calculate negatives #todo implement
2.363438
2
docs/end-to-end/library/GeocontribConnectLibrary.py
hcharp/geocontrib
3
6632756
# Copyright (c) 2017-2021 Neogeo-Technologies. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
# Copyright (c) 2017-2021 Neogeo-Technologies. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
en
0.83867
# Copyright (c) 2017-2021 Neogeo-Technologies. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
2.20505
2
databin/parsers/__init__.py
LeTristanB/databin
0
6632757
from databin.parsers.util import ParseException from databin.parsers.simple import parse_dsv, parse_tsv, parse_ssv, pandas_parser from databin.parsers.psql import parse_psql PARSERS = [ ('Auto Detect', "pandas_table", pandas_parser), ('Excel copy & paste', 'excel', parse_tsv), ('PostgreSQL Shell', 'psql', ...
from databin.parsers.util import ParseException from databin.parsers.simple import parse_dsv, parse_tsv, parse_ssv, pandas_parser from databin.parsers.psql import parse_psql PARSERS = [ ('Auto Detect', "pandas_table", pandas_parser), ('Excel copy & paste', 'excel', parse_tsv), ('PostgreSQL Shell', 'psql', ...
none
1
2.760824
3
main.py
yutongshen/DSAI-Subtractor
0
6632758
import numpy as np import random import pickle import os.path # Parameters Config SUB = 0 SUB_ADD = 1 MULTIPLY = 2 DIGITS = 4 TRAINING_SIZE = 18000 VALIDATION_SIZE = 2000 TESTING_SIZE = 60000 ITERATION = 100 TOTAL_SIZE = TRAINING_SIZE + VALIDATION_SIZE + TESTING_SIZE GEN_TYPE = ...
import numpy as np import random import pickle import os.path # Parameters Config SUB = 0 SUB_ADD = 1 MULTIPLY = 2 DIGITS = 4 TRAINING_SIZE = 18000 VALIDATION_SIZE = 2000 TESTING_SIZE = 60000 ITERATION = 100 TOTAL_SIZE = TRAINING_SIZE + VALIDATION_SIZE + TESTING_SIZE GEN_TYPE = ...
en
0.797804
# Parameters Config # Data Generation # query = '{}{}{}'.format(a, op, b).ljust(MAXLEN) # Processing # Model # - Using sequence to sequence model # - Encoder: bi-directional LSTM # - Decoder: LSTM # Set up the decoder, which will only process one timestep at a time. # Run the decoder on one timestep # Reinject the outp...
2.669055
3
legacy/legacy/utils/evaluators/recall.py
csmithchicago/openrec
0
6632759
<filename>legacy/legacy/utils/evaluators/recall.py import numpy as np from openrec.legacy.utils.evaluators import Evaluator class Recall(Evaluator): def __init__(self, recall_at, name="Recall"): self._recall_at = np.array(recall_at) super(Recall, self).__init__(etype="rank", name=name) def ...
<filename>legacy/legacy/utils/evaluators/recall.py import numpy as np from openrec.legacy.utils.evaluators import Evaluator class Recall(Evaluator): def __init__(self, recall_at, name="Recall"): self._recall_at = np.array(recall_at) super(Recall, self).__init__(etype="rank", name=name) def ...
none
1
2.738742
3
ncrystal_python/__init__.py
highness-eu/ncrystal
1
6632760
#!/usr/bin/env python3 """Python module for using the NCrystal library for thermal neutron transport in crystals Please find more information about NCrystal at the website: https://mctools.github.io/ncrystal/ In particular, a small example using the NCrystal python module can be found at: https://github.com/m...
#!/usr/bin/env python3 """Python module for using the NCrystal library for thermal neutron transport in crystals Please find more information about NCrystal at the website: https://mctools.github.io/ncrystal/ In particular, a small example using the NCrystal python module can be found at: https://github.com/m...
en
0.804147
#!/usr/bin/env python3 Python module for using the NCrystal library for thermal neutron transport in crystals Please find more information about NCrystal at the website: https://mctools.github.io/ncrystal/ In particular, a small example using the NCrystal python module can be found at: https://github.com/mcto...
2.627468
3
SubtitleSearcher/data/handle_zip.py
razorblade23/SubtitleSearcher
3
6632761
<reponame>razorblade23/SubtitleSearcher # Importing modules import zipfile import requests import os from zipfile import ZipFile import shutil # Move subtitles (OpenSubtitles.com) def move_subtitle(mode, source_path, dst_path, append_lang_code=None): org_string = dst_path size = len(org_string) mod_string ...
# Importing modules import zipfile import requests import os from zipfile import ZipFile import shutil # Move subtitles (OpenSubtitles.com) def move_subtitle(mode, source_path, dst_path, append_lang_code=None): org_string = dst_path size = len(org_string) mod_string = org_string[:size - 4] if append_la...
en
0.786954
# Importing modules # Move subtitles (OpenSubtitles.com) # Move subtitles (Titlovi.com) Base class of File Handler. Not to be called directly. Instantiate from child classes. Used to handle all common operations with subtitle files like downloading and unzipping. Child classes handle diffrent aproaches by diff...
2.886353
3
ckanext/datapusher/tests/test.py
Pardhu448/ckan
0
6632762
<reponame>Pardhu448/ckan # encoding: utf-8 import datetime import json import pytest import responses import sqlalchemy.orm as orm import ckan.lib.create_test_data as ctd import ckan.model as model import ckan.plugins as p import ckan.tests.legacy as tests import ckanext.datastore.backend.postgres as db from ckan.co...
# encoding: utf-8 import datetime import json import pytest import responses import sqlalchemy.orm as orm import ckan.lib.create_test_data as ctd import ckan.model as model import ckan.plugins as p import ckan.tests.legacy as tests import ckanext.datastore.backend.postgres as db from ckan.common import config from c...
en
0.83829
# encoding: utf-8
1.884079
2
api/sources/coingecko.py
aalavanthan18/kylin-api
0
6632763
from api.sources import source_config from api.sources.generic_source import GenericSource import requests from datetime import datetime class CoinGecko(GenericSource): def __init__(self): self.url = source_config.sources["coingecko"]['url'] self.source_name = source_config.sources["coingecko"]['so...
from api.sources import source_config from api.sources.generic_source import GenericSource import requests from datetime import datetime class CoinGecko(GenericSource): def __init__(self): self.url = source_config.sources["coingecko"]['url'] self.source_name = source_config.sources["coingecko"]['so...
none
1
2.729901
3
tensorflow/python/autograph/pyct/error_utils_test.py
EricRemmerswaal/tensorflow
190,993
6632764
<reponame>EricRemmerswaal/tensorflow # Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICEN...
# Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
en
0.794467
# Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
2.085296
2
gestaoVendas/cadastros/urls.py
evton/Gestao-de-vendas
1
6632765
<gh_stars>1-10 from django.urls import path from . import views urlpatterns = [ path('cadastro/', views.novocliente, name='cadastrocliente'), ]
from django.urls import path from . import views urlpatterns = [ path('cadastro/', views.novocliente, name='cadastrocliente'), ]
none
1
1.452414
1
embedding_propagation/__init__.py
dvd42/embedding-propagation
0
6632766
from .embedding_propagation import *
from .embedding_propagation import *
none
1
1.100213
1
Support/Fuego/Pythia/pythia-0.4/packages/fuego/fuego/serialization/chemkin/unpickle/parsers/Thermo.py
marient/PelePhysics
1
6632767
#!/usr/bin/env python # # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # # <NAME> # California Institute of Technology # (C) 1998-2003 All Rights Reserved # # <LicenseText> # # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...
#!/usr/bin/env python # # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # # <NAME> # California Institute of Technology # (C) 1998-2003 All Rights Reserved # # <LicenseText> # # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...
en
0.558607
#!/usr/bin/env python # # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # # <NAME> # California Institute of Technology # (C) 1998-2003 All Rights Reserved # # <LicenseText> # # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...
2.773103
3
game.py
cxong/Slappa
7
6632768
from game_object_factory import * from game_time import * from loader import * from scale_manager import * from state import * from world import * class Game(object): def __init__(self, caption, width, height): pygame.mixer.pre_init(frequency=44100, size=-16, channels=2, buffer=1024) pygame.init()...
from game_object_factory import * from game_time import * from loader import * from scale_manager import * from state import * from world import * class Game(object): def __init__(self, caption, width, height): pygame.mixer.pre_init(frequency=44100, size=-16, channels=2, buffer=1024) pygame.init()...
en
0.791713
# Do one last draw
2.566073
3
slbooking/admin_actions.py
gocept/slbooking
0
6632769
<filename>slbooking/admin_actions.py<gh_stars>0 from flask import ( Blueprint, flash, g, redirect, render_template, request, url_for, session ) from werkzeug.exceptions import abort from werkzeug.security import check_password_hash, generate_password_hash from slbooking.admin import admin_login_required from slboo...
<filename>slbooking/admin_actions.py<gh_stars>0 from flask import ( Blueprint, flash, g, redirect, render_template, request, url_for, session ) from werkzeug.exceptions import abort from werkzeug.security import check_password_hash, generate_password_hash from slbooking.admin import admin_login_required from slboo...
none
1
2.091374
2
enrich/followthemoney_enrich/cli.py
tendai-zw/followthemoney
1
6632770
import json import click import logging from banal import is_mapping from followthemoney.namespace import Namespace from followthemoney.dedupe import Recon, EntityLinker from followthemoney.cli.cli import cli from followthemoney.cli.util import read_entity, write_object from followthemoney_enrich import get_enricher, ...
import json import click import logging from banal import is_mapping from followthemoney.namespace import Namespace from followthemoney.dedupe import Recon, EntityLinker from followthemoney.cli.cli import cli from followthemoney.cli.util import read_entity, write_object from followthemoney_enrich import get_enricher, ...
uz
0.44857
# noqa # noqa # noqa # noqa # noqa
2.055359
2
tabdoc/__init__.py
lpcheng1208/tabdoc
1
6632771
#!/usr/bin/env python3 # coding=utf-8 """ @author: guoyanfeng @software: PyCharm @time: 19-3-20 下午6:29 """ __version__ = "1.0.0b9" from .tabexcel import * from .tabpdf import * from .tabword import *
#!/usr/bin/env python3 # coding=utf-8 """ @author: guoyanfeng @software: PyCharm @time: 19-3-20 下午6:29 """ __version__ = "1.0.0b9" from .tabexcel import * from .tabpdf import * from .tabword import *
en
0.147215
#!/usr/bin/env python3 # coding=utf-8 @author: guoyanfeng @software: PyCharm @time: 19-3-20 下午6:29
1.048901
1
test/test_general.py
iansmcf/busybees
0
6632772
<gh_stars>0 import threading import time import sys from busybees import worker from busybees import hive import pash class ErrWorker(worker.Worker): def work(self, command): proc = pash.ShellProc() proc.run(command) return "Exit code: %s" % proc.get_val('exit_code') def test_hive(): ...
import threading import time import sys from busybees import worker from busybees import hive import pash class ErrWorker(worker.Worker): def work(self, command): proc = pash.ShellProc() proc.run(command) return "Exit code: %s" % proc.get_val('exit_code') def test_hive(): apiary = hi...
none
1
2.234376
2
sold_anisotrop.py
shongi-yd/FEniCSopt
0
6632773
from dolfin import * from scipy.optimize import minimize import numpy as np import time as pyt import pprint coth = lambda x: 1./np.tanh(x) from fenicsopt.core.convdif import * from fenicsopt.examples.sc_examples import sc_setup import fenicsopt.exports.results as rs ##################################################...
from dolfin import * from scipy.optimize import minimize import numpy as np import time as pyt import pprint coth = lambda x: 1./np.tanh(x) from fenicsopt.core.convdif import * from fenicsopt.examples.sc_examples import sc_setup import fenicsopt.exports.results as rs ##################################################...
de
0.293259
################################################################################ # 8, 9, 20, 55 # Mesh #mesh = UnitSquareMesh(NUM_CELL,NUM_CELL) # Whole Boundary # Function Spaces on the mesh # Data # ! possible division by 0 # Basic Definitions # Constant(V.ufl_element().degree())
2.202805
2
HackerRank/30 Days of Code/Day 20 - Sorting.py
anubhab-code/Competitive-Programming
0
6632774
import sys n = int(input().strip()) a = list(map(int, input().strip().split(' '))) numSwaps = 0 for i in range(n): currentSwaps = 0 for j in range(n-1): if a[j] > a[j+1]: tmp = a[j] a[j] = a[j+1] a[j+1] = tmp numSwaps += 1 currentSwaps += 1 ...
import sys n = int(input().strip()) a = list(map(int, input().strip().split(' '))) numSwaps = 0 for i in range(n): currentSwaps = 0 for j in range(n-1): if a[j] > a[j+1]: tmp = a[j] a[j] = a[j+1] a[j+1] = tmp numSwaps += 1 currentSwaps += 1 ...
none
1
3.147838
3
test/mbedapi.py
yinglangli/ARMmbed_DAPLink
0
6632775
<reponame>yinglangli/ARMmbed_DAPLink # # DAPLink Interface Firmware # Copyright (c) 2009-2016, ARM Limited, All Rights Reserved # SPDX-License-Identifier: Apache-2.0 # # 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 ...
# # DAPLink Interface Firmware # Copyright (c) 2009-2016, ARM Limited, All Rights Reserved # SPDX-License-Identifier: Apache-2.0 # # 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...
en
0.625233
# # DAPLink Interface Firmware # Copyright (c) 2009-2016, ARM Limited, All Rights Reserved # SPDX-License-Identifier: Apache-2.0 # # 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...
2.121347
2
ex0008.py
dev-cesaraugusto/Atividades-resolvidas-Python
0
6632776
<reponame>dev-cesaraugusto/Atividades-resolvidas-Python<filename>ex0008.py<gh_stars>0 '''Escreva um programa que leia um valor em metros e o exiba convertido em centímetros e milímetros''' n1 = float(input('Escreva a medida: ')) c = n1 * 100 mi = n1 * 1000 print('{} metros é igual a {} centímetros e {} milímetros.'.for...
'''Escreva um programa que leia um valor em metros e o exiba convertido em centímetros e milímetros''' n1 = float(input('Escreva a medida: ')) c = n1 * 100 mi = n1 * 1000 print('{} metros é igual a {} centímetros e {} milímetros.'.format(n1,c,mi))
pt
0.932663
Escreva um programa que leia um valor em metros e o exiba convertido em centímetros e milímetros
4.031972
4
FortressOfSolitude/_FortressOfSolitude/NeutrinoKey/forms.py
BDD16/FortressOfSolitude
0
6632777
""" DBA 1337_TECH, AUSTIN TEXAS © MAY 2021 Proof of Concept code, No liabilities or warranties expressed or implied. """ from django import forms from django.core.exceptions import ValidationError from .models import NewsLink, Startup, Tag, Tasking from datetime import datetime class DownloadFileForm(forms.Form): ...
""" DBA 1337_TECH, AUSTIN TEXAS © MAY 2021 Proof of Concept code, No liabilities or warranties expressed or implied. """ from django import forms from django.core.exceptions import ValidationError from .models import NewsLink, Startup, Tag, Tasking from datetime import datetime class DownloadFileForm(forms.Form): ...
en
0.795638
DBA 1337_TECH, AUSTIN TEXAS © MAY 2021 Proof of Concept code, No liabilities or warranties expressed or implied.
1.782682
2
students/K33422/Izmaylova_Anna/web_lab2/2.2/django_project_Izmaylova/urls.py
Anna0102/ITMO_ICT_WebDevelopment_2021-2022
0
6632778
from django.contrib import admin from django.urls import path, include urlpatterns = [ path('admin/', admin.site.urls), path('', include('project_first_app.urls')), #данная строчка импортирует в проект отдельный файл юрлов Вашего приложения (example6_app - название Вашего приложения (название папки)), urls указ...
from django.contrib import admin from django.urls import path, include urlpatterns = [ path('admin/', admin.site.urls), path('', include('project_first_app.urls')), #данная строчка импортирует в проект отдельный файл юрлов Вашего приложения (example6_app - название Вашего приложения (название папки)), urls указ...
ru
0.99368
#данная строчка импортирует в проект отдельный файл юрлов Вашего приложения (example6_app - название Вашего приложения (название папки)), urls указывает на файл юрлов в папке приложения (указывает на тот пустой файл, который мы создали в пункте 9.а.
1.934251
2
config.py
RonquilloAeon/flask-starter
0
6632779
import os DEBUG = os.environ.get('DEBUG', False)
import os DEBUG = os.environ.get('DEBUG', False)
none
1
1.219324
1
Python/code case/code case 164.py
amazing-2020/pdf
3
6632780
from random import randrange, shuffle def bubble_sort(): array = [] while len(array) < 12: array.append(randrange(-99, 101, 3)) shuffle(array) print(array) for i in range(12): for j in range(11 - i): if array[j] > array[j+1]: array[j], array[j+1] = array...
from random import randrange, shuffle def bubble_sort(): array = [] while len(array) < 12: array.append(randrange(-99, 101, 3)) shuffle(array) print(array) for i in range(12): for j in range(11 - i): if array[j] > array[j+1]: array[j], array[j+1] = array...
none
1
4.205186
4
backend/stock_k_line.py
wuxianliang/StockBrain
2
6632781
from flask import jsonify def get_s_k(k_data, stock_code): if stock_code[0] == '6': stock_code = stock_code + '.SH' elif stock_code[0] == '0' or stock_code[0] == '3': stock_code = stock_code + '.SZ' stock = k_data.loc[k_data['S_INFO_WINDCODE'] == stock_code] result = stock.sort_values(b...
from flask import jsonify def get_s_k(k_data, stock_code): if stock_code[0] == '6': stock_code = stock_code + '.SH' elif stock_code[0] == '0' or stock_code[0] == '3': stock_code = stock_code + '.SZ' stock = k_data.loc[k_data['S_INFO_WINDCODE'] == stock_code] result = stock.sort_values(b...
none
1
2.547966
3
boilerplate/app/controllers/default.py
davideasaf/effortless_rest_flask
0
6632782
<gh_stars>0 from flask import abort, jsonify, request from flask_accepts import responds, accepts from flask_praetorian import roles_required from flask_restx import Namespace, Resource from app import api, guard from app.models import User from app.schemas import UserSchema, UserLoginSchema @api.route("/login") cla...
from flask import abort, jsonify, request from flask_accepts import responds, accepts from flask_praetorian import roles_required from flask_restx import Namespace, Resource from app import api, guard from app.models import User from app.schemas import UserSchema, UserLoginSchema @api.route("/login") class UserLogin...
en
0.55521
# I can confidently access parsed_args based on @accepts criteria # use request.parsed_obj for body # use request.parsed_args for query params
2.430612
2
4. Organizational Widgets/paned_window.py
samujjwaal/Tkinter-GUI-Course
0
6632783
<reponame>samujjwaal/Tkinter-GUI-Course<gh_stars>0 from tkinter import * from tkinter import ttk root = Tk() # paned window object,panes stacked next to each other paned_window = ttk.PanedWindow(root, orient=HORIZONTAL) # BOTH: to expand and fill entire space inside window # expand: to allow panes to expand on resizi...
from tkinter import * from tkinter import ttk root = Tk() # paned window object,panes stacked next to each other paned_window = ttk.PanedWindow(root, orient=HORIZONTAL) # BOTH: to expand and fill entire space inside window # expand: to allow panes to expand on resizing window paned_window.pack(fill=BOTH, expand=True)...
en
0.862517
# paned window object,panes stacked next to each other # BOTH: to expand and fill entire space inside window # expand: to allow panes to expand on resizing window # add frames with scale weight # insert new pane between 0 and 1 panes # to no longer display pane at index 1
4.237733
4
tests/test_0166-0167-0170-random-issues.py
colesbury/awkward-1.0
0
6632784
<reponame>colesbury/awkward-1.0 # BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/main/LICENSE import pytest # noqa: F401 import numpy as np # noqa: F401 import awkward as ak # noqa: F401 def test_0166_IndexedOptionArray(): array = ak.Array([[2, 3, 5], None, [], [7, 11], None, [13], ...
# BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/main/LICENSE import pytest # noqa: F401 import numpy as np # noqa: F401 import awkward as ak # noqa: F401 def test_0166_IndexedOptionArray(): array = ak.Array([[2, 3, 5], None, [], [7, 11], None, [13], None, [17, 19]]) assert ak.t...
en
0.392246
# BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/main/LICENSE # noqa: F401 # noqa: F401 # noqa: F401
2.115391
2
src/api-engine/api/auth.py
tianxuanhong/cello
0
6632785
<filename>src/api-engine/api/auth.py import logging import os from django.conf import settings from django.core.exceptions import ObjectDoesNotExist from rest_framework import authentication from rest_framework.permissions import BasePermission from rest_framework.exceptions import AuthenticationFailed from rest_frame...
<filename>src/api-engine/api/auth.py import logging import os from django.conf import settings from django.core.exceptions import ObjectDoesNotExist from rest_framework import authentication from rest_framework.permissions import BasePermission from rest_framework.exceptions import AuthenticationFailed from rest_frame...
en
0.770807
#organization_id = user.organization.id #organization_name = user.organization.name #request.user. Allows access only to authenticated users. Allows access only to operators. Allows access only to authenticated users.
2.219155
2
pyep11/ep11.py
quantumbitcoin/secure-bitcoin-wallet
0
6632786
<filename>pyep11/ep11.py CKM_RSA_PKCS_KEY_PAIR_GEN = 0x00000000 CKM_MD5_RSA_PKCS = 0x00000005 CKM_SHA256_RSA_PKCS = 0x00000040 CKM_ECDSA_SHA1 = 0x00001042 CKM_EC_KEY_PAIR_GEN = 0x00001040 CKM_AES_KEY_GEN = 0x00001080 CKM_AES_CBC = 0x00001082 CKM_AES_CBC_PAD = 0...
<filename>pyep11/ep11.py CKM_RSA_PKCS_KEY_PAIR_GEN = 0x00000000 CKM_MD5_RSA_PKCS = 0x00000005 CKM_SHA256_RSA_PKCS = 0x00000040 CKM_ECDSA_SHA1 = 0x00001042 CKM_EC_KEY_PAIR_GEN = 0x00001040 CKM_AES_KEY_GEN = 0x00001080 CKM_AES_CBC = 0x00001082 CKM_AES_CBC_PAD = 0...
en
0.339591
# CKA_VALUE_LEN # CKA_WRAP # CKA_UNWRAP # CKA_ENCRYPT # CKA_DECRYPT, # CKA_EXTRACTABLE # CKA_TOKEN
1.422128
1
pyleecan/Methods/Machine/LamSlotWind/comp_mmf_unit.py
EmileDvs/pyleecan
95
6632787
# -*- coding: utf-8 -*- from numpy import pi, linspace, zeros, ones, dot, squeeze from SciDataTool import Data1D, DataTime, Norm_ref from ....Functions.Electrical.coordinate_transformation import dq2n from ....Functions.Winding.gen_phase_list import gen_name from pyleecan.Classes.Winding import Winding def comp_mmf_u...
# -*- coding: utf-8 -*- from numpy import pi, linspace, zeros, ones, dot, squeeze from SciDataTool import Data1D, DataTime, Norm_ref from ....Functions.Electrical.coordinate_transformation import dq2n from ....Functions.Winding.gen_phase_list import gen_name from pyleecan.Classes.Winding import Winding def comp_mmf_u...
en
0.508713
# -*- coding: utf-8 -*- Compute the winding Unit magnetomotive force Parameters ---------- self : LamSlotWind an LamSlotWind object Na : int Space discretization for offline computation (otherwise use out.elec.angle) Nt : int Time discretization for offline computation (othe...
2.626157
3
solum-6.0.0/solum/tests/deployer/handlers/test_noop.py
scottwedge/OpenStack-Stein
0
6632788
<reponame>scottwedge/OpenStack-Stein # Copyright 2014 - 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 requir...
# Copyright 2014 - 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.84661
# Copyright 2014 - 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 ...
1.856271
2
Andromeda/run.py
Kittex0/Andromeda
0
6632789
<filename>Andromeda/run.py while True: qs = input("> ") with open("Responses.txt", "r") as file: data = file.readlines() # reads it line by line for i in data: if qs == i.split(" = ")[0]: answer = i.split(" = ")[1] print(answer)
<filename>Andromeda/run.py while True: qs = input("> ") with open("Responses.txt", "r") as file: data = file.readlines() # reads it line by line for i in data: if qs == i.split(" = ")[0]: answer = i.split(" = ")[1] print(answer)
en
0.995266
# reads it line by line
3.113677
3
stock_forecast.py
whitecat-22/prophet
0
6632790
import numpy as np import pandas as pd import matplotlib.pyplot as plt import sys from fbprophet import Prophet from fbprophet.diagnostics import cross_validation from fbprophet.diagnostics import performance_metrics from fbprophet.plot import plot_cross_validation_metric data = pd.DataFrame() args = sys.argv file_nam...
import numpy as np import pandas as pd import matplotlib.pyplot as plt import sys from fbprophet import Prophet from fbprophet.diagnostics import cross_validation from fbprophet.diagnostics import performance_metrics from fbprophet.plot import plot_cross_validation_metric data = pd.DataFrame() args = sys.argv file_nam...
en
0.626908
#ここでデータファイルを読み込む #MSEをプロットする関数をデバッグのために再定義 Plot a performance metric vs. forecast horizon from cross validation. Cross validation produces a collection of out-of-sample model predictions that can be compared to actual values, at a range of different horizons (distance from the cutoff). This computes a speci...
2.439542
2
kick/device2/ssp/actions/statements.py
CiscoDevNet/firepower-kickstart
2
6632791
<reponame>CiscoDevNet/firepower-kickstart from unicon.eal.dialogs import Statement def login_handler(spawn, patterns): spawn.sendline(patterns.login_username) spawn.expect('Password: ') spawn.sendline(patterns.login_password) spawn.expect('Cisco Firepower') spawn.sendline() class SspStatements: ...
from unicon.eal.dialogs import Statement def login_handler(spawn, patterns): spawn.sendline(patterns.login_username) spawn.expect('Password: ') spawn.sendline(patterns.login_password) spawn.expect('Cisco Firepower') spawn.sendline() class SspStatements: def __init__(self, patterns): ...
none
1
2.103792
2
card.py
HousedHorse/study-buddy
1
6632792
from fpdf import FPDF class Cards(FPDF): def __init__(self, orientation = 'P', unit = 'mm', format='A4'): super().__init__(orientation, unit, format) self.cards = [] self.curr_card = 0 # we do not want to auto page break self.set_auto_page_break(False) def add_card(self...
from fpdf import FPDF class Cards(FPDF): def __init__(self, orientation = 'P', unit = 'mm', format='A4'): super().__init__(orientation, unit, format) self.cards = [] self.curr_card = 0 # we do not want to auto page break self.set_auto_page_break(False) def add_card(self...
en
0.803421
# we do not want to auto page break # draw each card # draw card # check to see if we went over the page; if so, print a warning # increment card number # write card to file # blank page with just title # page with information # card contents # insert an extra page break before printing subtitles # but only if they are...
3.1966
3
mabooia/accounting/__init__.py
Mabooia/mabooia-py
0
6632793
from .enums import * from .timeline import *
from .enums import * from .timeline import *
none
1
1.08423
1
ml-agents/mlagents/trainers/sac/trainer.py
XiaoDiDiDa/ml-agents
0
6632794
# # Unity ML-Agents Toolkit # ## ML-Agent Learning (SAC) # Contains an implementation of SAC as described in https://arxiv.org/abs/1801.01290 # and implemented in https://github.com/hill-a/stable-baselines import logging from collections import defaultdict from typing import Dict import os import numpy as np from ml...
# # Unity ML-Agents Toolkit # ## ML-Agent Learning (SAC) # Contains an implementation of SAC as described in https://arxiv.org/abs/1801.01290 # and implemented in https://github.com/hill-a/stable-baselines import logging from collections import defaultdict from typing import Dict import os import numpy as np from ml...
en
0.826342
# # Unity ML-Agents Toolkit # ## ML-Agent Learning (SAC) # Contains an implementation of SAC as described in https://arxiv.org/abs/1801.01290 # and implemented in https://github.com/hill-a/stable-baselines The SACTrainer is an implementation of the SAC algorithm, with support for discrete actions and recurrent netw...
2.470122
2
egs/datasets/audio/lj/preprocess.py
leminhnguyen/NATSpeech
561
6632795
<reponame>leminhnguyen/NATSpeech from data_gen.tts.base_preprocess import BasePreprocessor class LJPreprocess(BasePreprocessor): def meta_data(self): for l in open(f'{self.raw_data_dir}/metadata.csv').readlines(): item_name, _, txt = l.strip().split("|") wav_fn = f"{self.raw_data_d...
from data_gen.tts.base_preprocess import BasePreprocessor class LJPreprocess(BasePreprocessor): def meta_data(self): for l in open(f'{self.raw_data_dir}/metadata.csv').readlines(): item_name, _, txt = l.strip().split("|") wav_fn = f"{self.raw_data_dir}/wavs/{item_name}.wav" ...
none
1
2.538705
3
TPS_dice_roller_bot/core/spongebob_feature.py
JacopoDeAngelis/TPS-dice-roller-bot
0
6632796
### spongebob_sentence(message) # take the message text and returns a sentence with alternating upper and lowercase chars def spongebob_sentence(message_text): message_split = message_text.split() if '/spongebob' in message_split: message_split = message_split[message_split.index('/spongebob') + 1:len...
### spongebob_sentence(message) # take the message text and returns a sentence with alternating upper and lowercase chars def spongebob_sentence(message_text): message_split = message_text.split() if '/spongebob' in message_split: message_split = message_split[message_split.index('/spongebob') + 1:len...
en
0.638156
### spongebob_sentence(message) # take the message text and returns a sentence with alternating upper and lowercase chars # takes every string in the list # takes every char in string and iterate counting the element index
4.078435
4
lib/common/error.py
smallstrong0/easy_python
2
6632797
<filename>lib/common/error.py # ! /usr/bin/env python # -*- coding: utf-8 -*- from enum import Enum from tornado.web import HTTPError status_0 = dict(status_code=405, reason='Method not allowed.') status_1 = dict(status_code=404, reason='API not found.') class BMCError(HTTPError): def __init__(self, error): ...
<filename>lib/common/error.py # ! /usr/bin/env python # -*- coding: utf-8 -*- from enum import Enum from tornado.web import HTTPError status_0 = dict(status_code=405, reason='Method not allowed.') status_1 = dict(status_code=404, reason='API not found.') class BMCError(HTTPError): def __init__(self, error): ...
en
0.289356
# ! /usr/bin/env python # -*- coding: utf-8 -*- # 示例相关 # 测试相关
2.283439
2
test_mathlib.py
locspoc/python-test-driven-development
0
6632798
<filename>test_mathlib.py import mathlib def test_calc_total(): total = mathlib.calc_total(4,5) assert total == 9 def test_calc_multiply(): result = mathlib.calc_multiply(10,3) assert result == 30
<filename>test_mathlib.py import mathlib def test_calc_total(): total = mathlib.calc_total(4,5) assert total == 9 def test_calc_multiply(): result = mathlib.calc_multiply(10,3) assert result == 30
none
1
2.870033
3
solutions/Count Submatrices With All Ones/solution.py
nilax97/leetcode-solutions
3
6632799
class Solution: def numSubmat(self, mat: List[List[int]]) -> int: m, n = len(mat), len(mat[0]) #precipitate mat to histogram for i in range(m): for j in range(n): if mat[i][j] and i > 0: mat[i][j] += mat[i-1][j] #histogram ...
class Solution: def numSubmat(self, mat: List[List[int]]) -> int: m, n = len(mat), len(mat[0]) #precipitate mat to histogram for i in range(m): for j in range(n): if mat[i][j] and i > 0: mat[i][j] += mat[i-1][j] #histogram ...
en
0.534185
#precipitate mat to histogram #histogram #mono-stack of indices of non-decreasing height #start #end #adjust to reflect lower height #count submatrices bottom-right at (i, j)
3.204834
3
lang/py/cookbook/v2/source/cb2_6_21_exm_2.py
ch1huizong/learning
0
6632800
class Foo(object): def meth1(self, arg): print arg def meth2(self, arg): print -arg
class Foo(object): def meth1(self, arg): print arg def meth2(self, arg): print -arg
none
1
2.612411
3
ParlAI/tests/test_zootasks.py
UmaTaru/run
163
6632801
<reponame>UmaTaru/run #!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. """ Test common developer mistakes in the model zoo and task list. Mostly just ensures the docs w...
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. """ Test common developer mistakes in the model zoo and task list. Mostly just ensures the docs will output nicely. """...
en
0.865132
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. Test common developer mistakes in the model zoo and task list. Mostly just ensures the docs will output nicely. Make sure...
2.539374
3
heroes/heroes/serializers.py
devrishik/Heroes
0
6632802
<gh_stars>0 from rest_framework import serializers from .models import * class PowerSerializer(serializers.ModelSerializer): class Meta: model = Power fields = ('name',) class WeaknessSerializer(serializers.ModelSerializer): class Meta: model = Weakness fields = ('name',) cla...
from rest_framework import serializers from .models import * class PowerSerializer(serializers.ModelSerializer): class Meta: model = Power fields = ('name',) class WeaknessSerializer(serializers.ModelSerializer): class Meta: model = Weakness fields = ('name',) class Attribute...
none
1
2.374032
2
kinoko/misc/web.py
koyo922/kinoko
13
6632803
<gh_stars>10-100 #!/usr/bin/env python # -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 expandtab number """ utils for web developing - a simple RESTful decorater for testing purpose Authors: qianweishuo<<EMAIL>> Date: 2019/7/11 下午3:59 """ from __future__ import unicode_literals import socket import warnings ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 expandtab number """ utils for web developing - a simple RESTful decorater for testing purpose Authors: qianweishuo<<EMAIL>> Date: 2019/7/11 下午3:59 """ from __future__ import unicode_literals import socket import warnings import six impor...
en
0.560637
#!/usr/bin/env python # -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 expandtab number utils for web developing - a simple RESTful decorater for testing purpose Authors: qianweishuo<<EMAIL>> Date: 2019/7/11 下午3:59 # pragma: no cover Decorator class; simply wrapping a function into a RESTful GET service Us...
2.459531
2
mb/ed/definition.py
ajah/represent-canada-data
0
6632804
<reponame>ajah/represent-canada-data from datetime import date import boundaries boundaries.register('Manitoba electoral districts', domain='Manitoba', last_updated=date(2011, 11, 1), name_func=boundaries.dashed_attr('ED'), authority='Her Majesty the Queen in Right of Manitoba', source_url='https:...
from datetime import date import boundaries boundaries.register('Manitoba electoral districts', domain='Manitoba', last_updated=date(2011, 11, 1), name_func=boundaries.dashed_attr('ED'), authority='Her Majesty the Queen in Right of Manitoba', source_url='https://mli2.gov.mb.ca/adminbnd/index.html'...
none
1
1.684003
2
configurations.py
davidpierre21/doe-sangue-scrapy
1
6632805
from decouple import config class Config(object): MONGODB_SERVER = config('MONGODB_SERVER') MONGODB_PORT = config('MONGODB_PORT') MONGODB_DB = config('MONGODB_DB') ENV = config('FLASK_ENV') MONGO_URI = f"mongodb://{MONGODB_SERVER}:{MONGODB_PORT}/{MONGODB_DB}" class ProductionConfig(Config): ...
from decouple import config class Config(object): MONGODB_SERVER = config('MONGODB_SERVER') MONGODB_PORT = config('MONGODB_PORT') MONGODB_DB = config('MONGODB_DB') ENV = config('FLASK_ENV') MONGO_URI = f"mongodb://{MONGODB_SERVER}:{MONGODB_PORT}/{MONGODB_DB}" class ProductionConfig(Config): ...
none
1
2.281067
2
game/__init__.py
marblexu/gearhead-caramel
0
6632806
<reponame>marblexu/gearhead-caramel import exploration import combat import teams import content import ghdialogue import configedit import invoker import cosplay import chargen import services import fieldhq from game.fieldhq import backpack def start_campaign(pc_egg,adv_type="SCENARIO_DEADZONEDRIFTER"): camp = ...
import exploration import combat import teams import content import ghdialogue import configedit import invoker import cosplay import chargen import services import fieldhq from game.fieldhq import backpack def start_campaign(pc_egg,adv_type="SCENARIO_DEADZONEDRIFTER"): camp = content.narrative_convenience_functi...
none
1
1.71511
2
modules/pmg_tk/TextEditor.py
NIRAJbme/pymol
0
6632807
''' Simple Text Editor ''' import os import sys if sys.version_info[0] == 2: import Tkinter import tkFileDialog import tkMessageBox else: import tkinter as Tkinter import tkinter.filedialog as tkFileDialog import tkinter.messagebox as tkMessageBox class TextEditor: def _write(self, handl...
''' Simple Text Editor ''' import os import sys if sys.version_info[0] == 2: import Tkinter import tkFileDialog import tkMessageBox else: import tkinter as Tkinter import tkinter.filedialog as tkFileDialog import tkinter.messagebox as tkMessageBox class TextEditor: def _write(self, handl...
en
0.287367
Simple Text Editor
3.387452
3
generate_free.py
lkugler/DART-WRF
1
6632808
<reponame>lkugler/DART-WRF #!/usr/bin/python3 """ running the forecast model without assimilation """ import os, sys, shutil import datetime as dt import pandas as pd from slurmpy import Slurm from config.cfg import exp, cluster from dartwrf.utils import script_to_str, symlink log_dir = cluster.archivedir+'/logs/' sl...
#!/usr/bin/python3 """ running the forecast model without assimilation """ import os, sys, shutil import datetime as dt import pandas as pd from slurmpy import Slurm from config.cfg import exp, cluster from dartwrf.utils import script_to_str, symlink log_dir = cluster.archivedir+'/logs/' slurm_scripts_dir = cluster.a...
en
0.241405
#!/usr/bin/python3 running the forecast model without assimilation ################################ # create initial conditions #id = wrfinput_insert_wbubble(perturb=True, depends_on=id) #restarts = [dt.datetime(2008, 7, 30, 11)] # dummy value #output_restart_interval=720, #sys.exit() # free run, no restart files anymo...
1.949933
2
setup.py
vedavamadathil/smake
23
6632809
import setuptools # Create the package with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( name = 'smake', version = '1.2.3', scripts = ['smake'], author = "<NAME>", author_email = "<EMAIL>", description = "A simple and convenient build...
import setuptools # Create the package with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( name = 'smake', version = '1.2.3', scripts = ['smake'], author = "<NAME>", author_email = "<EMAIL>", description = "A simple and convenient build...
en
0.657942
# Create the package
1.59847
2
pytests/security/x509main.py
bkumaran/testrunner
0
6632810
import logger from lib.Cb_constants.CBServer import CbServer log = logger.Logger.get_logger() from remote.remote_util import RemoteMachineShellConnection from membase.api.rest_client import RestConnection import httplib2 import base64 import requests import urllib.request, urllib.parse, urllib.error import random imp...
import logger from lib.Cb_constants.CBServer import CbServer log = logger.Logger.get_logger() from remote.remote_util import RemoteMachineShellConnection from membase.api.rest_client import RestConnection import httplib2 import base64 import requests import urllib.request, urllib.parse, urllib.error import random imp...
en
0.802973
status, ipAddress = commands.getstatusoutput("ifconfig en0 | grep 'inet addr:' | cut -d: -f2 |awk '{print $1}'") if '1' not in ipAddress: status, ipAddress = commands.getstatusoutput("ifconfig eth0 | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | awk '{print $2}'") return ipAddress Gets couc...
1.792002
2
test/wsgi/invocation/rewrite/test_path_rewriting_route_handler_decorator.py
keotl/jivago
12
6632811
<gh_stars>10-100 import unittest from unittest import mock from jivago.wsgi.invocation.rewrite.path_rewriting_route_handler_decorator import PathRewritingRouteHandlerDecorator from jivago.wsgi.invocation.route_handler import RouteHandler from test_utils.request_builder import RequestBuilder NEW_PATH = "/new-path" c...
import unittest from unittest import mock from jivago.wsgi.invocation.rewrite.path_rewriting_route_handler_decorator import PathRewritingRouteHandlerDecorator from jivago.wsgi.invocation.route_handler import RouteHandler from test_utils.request_builder import RequestBuilder NEW_PATH = "/new-path" class PathRewritin...
none
1
2.821739
3
untwisted/splits.py
iogf/untwisted
33
6632812
from untwisted.event import LOAD, Event import sys class Fixed: """ """ class FOUND(Event): pass def __init__(self, ssock, size=4): ssock.add_map(LOAD, self.update) self.arr = bytearray() self.size = size def update(self, ssock, data): self.arr.extend(dat...
from untwisted.event import LOAD, Event import sys class Fixed: """ """ class FOUND(Event): pass def __init__(self, ssock, size=4): ssock.add_map(LOAD, self.update) self.arr = bytearray() self.size = size def update(self, ssock, data): self.arr.extend(dat...
en
0.840916
Used to tokenize messages, it works on LOAD event and spawns Terminator.FOUND when it finds a given delimiter. Just an accumulator on LOAD. An accumulator that splits a message into two chunks based on a delimiter. It spawns AccUntil.DONE when such a delimiter is found.
2.569561
3
src/test.py
joagonzalez/tateti
1
6632813
<filename>src/test.py from game import Game, Player, Board import sys def test_player(): print("Player() class tests") dimension = 3 board_player = Board(dimension) print("Imprimimos tablero vacio: ") print(board_player) board_player.update_board([0, 2], 'X') board_player.update_board([0, 0]...
<filename>src/test.py from game import Game, Player, Board import sys def test_player(): print("Player() class tests") dimension = 3 board_player = Board(dimension) print("Imprimimos tablero vacio: ") print(board_player) board_player.update_board([0, 2], 'X') board_player.update_board([0, 0]...
en
0.265241
#board_player.update_board([2, 1], 'X') # board_2
3.301651
3
tests/validators/test_shared_potential_id_validator.py
NOWUM/EnSysMod
1
6632814
<gh_stars>1-10 from typing import Type, List, Tuple, Dict, Any import pytest from pydantic import BaseModel, ValidationError from ensysmod.model import EnergyComponentType from ensysmod.schemas import EnergyComponentUpdate, EnergyComponentCreate schemas_with_shared_potential_id_required: List[Tuple[Type[BaseModel], ...
from typing import Type, List, Tuple, Dict, Any import pytest from pydantic import BaseModel, ValidationError from ensysmod.model import EnergyComponentType from ensysmod.schemas import EnergyComponentUpdate, EnergyComponentCreate schemas_with_shared_potential_id_required: List[Tuple[Type[BaseModel], Dict[str, Any]]...
en
0.926534
Test that a shared potential id is optional for a schema Test that a shared potential id is optional for a schema Test that a shared potential id is not longer than 100 characters Test that a shared potential id with everything between 1 and 100 characters is valid
2.384945
2
mri_tools/shell_utils.py
movermeyer/mri-tools
0
6632815
<gh_stars>0 import os import subprocess import six __author__ = '<NAME>' __date__ = "2015-05-07" __maintainer__ = "<NAME>" __email__ = "<EMAIL>" def binary_in_path(command_name): """Check if the given command name for a binary exists in the users path. Args: command_name (str): the name of the comma...
import os import subprocess import six __author__ = '<NAME>' __date__ = "2015-05-07" __maintainer__ = "<NAME>" __email__ = "<EMAIL>" def binary_in_path(command_name): """Check if the given command name for a binary exists in the users path. Args: command_name (str): the name of the command to check ...
en
0.720749
Check if the given command name for a binary exists in the users path. Args: command_name (str): the name of the command to check for existence and executability Returns: bool: true if the command can be found and is executable, false otherwise. Get the path to the FSL dir Returns: ...
2.983705
3
userbot/modules/sqlsender.py
TAMILVIP007/javes-3.0
1
6632816
from userbot import client, CMD_HELP, CMD_LIST from telethon import events from userbot.events import javes05, rekcah05, zzaacckkyy, remove_plugin, load_module from telethon import functions, types from telethon.tl.types import InputMessagesFilterDocument from userbot.utils import command, remove_plugin, load_module fr...
from userbot import client, CMD_HELP, CMD_LIST from telethon import events from userbot.events import javes05, rekcah05, zzaacckkyy, remove_plugin, load_module from telethon import functions, types from telethon.tl.types import InputMessagesFilterDocument from userbot.utils import command, remove_plugin, load_module fr...
de
0.372393
# pylint:disable=E0602
1.944765
2
agent/data/CIFAR10/cifar10.py
kashu98/Deep-Agent
0
6632817
import pickle import numpy as np import os.path class CIFAR10: def __init__(self): self.dataset = {} self.path = os.path.dirname(os.path.abspath(__file__)) def _load_data(self, filename): with open(filename, 'rb') as file: dataset = pickle.load(file, encoding='bytes') ...
import pickle import numpy as np import os.path class CIFAR10: def __init__(self): self.dataset = {} self.path = os.path.dirname(os.path.abspath(__file__)) def _load_data(self, filename): with open(filename, 'rb') as file: dataset = pickle.load(file, encoding='bytes') ...
en
0.366333
## Arguments normalize : if true, normalize the input pixel one_hot_label : if true, creat one hot label flatten : if true, load the image as a line option: select option train: return train data only\n test: return test data only\n both: return both t...
2.618009
3
apps/API/serializers/category_serializers.py
ExpoAshique/ProveBanking__s
0
6632818
<filename>apps/API/serializers/category_serializers.py<gh_stars>0 from rest_framework import serializers from categories.models import Category class CategorySerializer(serializers.ModelSerializer): label = serializers.CharField(source='name') value = serializers.CharField(source='id') class Meta: ...
<filename>apps/API/serializers/category_serializers.py<gh_stars>0 from rest_framework import serializers from categories.models import Category class CategorySerializer(serializers.ModelSerializer): label = serializers.CharField(source='name') value = serializers.CharField(source='id') class Meta: ...
none
1
1.999258
2
python/ray/serve/tests/test_util.py
77loopin/ray
39
6632819
import json import numpy as np import pytest import ray from ray.serve.utils import ServeEncoder from ray._private.utils import import_attr def test_bytes_encoder(): data_before = {"inp": {"nest": b"bytes"}} data_after = {"inp": {"nest": "bytes"}} assert json.loads(json.dumps(data_before, cls=ServeEncod...
import json import numpy as np import pytest import ray from ray.serve.utils import ServeEncoder from ray._private.utils import import_attr def test_bytes_encoder(): data_before = {"inp": {"nest": b"bytes"}} data_after = {"inp": {"nest": "bytes"}} assert json.loads(json.dumps(data_before, cls=ServeEncod...
gl
0.179081
# Very meta...
2.082432
2
portfolio/Python/scrapy/dyersonline/googe_shopping_api.py
0--key/lib
0
6632820
import csv import codecs import cStringIO import os import copy import json from decimal import Decimal from scrapy.spider import BaseSpider from scrapy.selector import HtmlXPathSelector from scrapy.http import Request, HtmlResponse, FormRequest from scrapy.utils.response import get_base_url from scrapy.utils.url impo...
import csv import codecs import cStringIO import os import copy import json from decimal import Decimal from scrapy.spider import BaseSpider from scrapy.selector import HtmlXPathSelector from scrapy.http import Request, HtmlResponse, FormRequest from scrapy.utils.response import get_base_url from scrapy.utils.url impo...
en
0.914293
Iterator that reads an encoded stream and reencodes the input to UTF-8 A CSV reader which will iterate over lines in the CSV file "f", which is encoded in the given encoding. A CSV writer which will write rows to CSV file "f", which is encoded in the given encoding. # Redirect output to a queue # Fetch UTF-8 ou...
2.681036
3
api/api/getNewCSV.py
Servatom/30DaysOfCloudLeaderBoard
10
6632821
<filename>api/api/getNewCSV.py import imaplib import base64 import email import os import pandas as pd import schedule import time import os sender_email = os.environ.get('SENDER_EMAIL') if sender_email == None: sender_email = "<EMAIL>" last_read_email = "" def generateRandomString(): return base64.b64encod...
<filename>api/api/getNewCSV.py import imaplib import base64 import email import os import pandas as pd import schedule import time import os sender_email = os.environ.get('SENDER_EMAIL') if sender_email == None: sender_email = "<EMAIL>" last_read_email = "" def generateRandomString(): return base64.b64encod...
en
0.773106
# call function to fill db # check attachment for latest email # get date of email # before this loop first check email and then run web scraper in background # web scraper turned on # append loop in txt file
2.926975
3
tests/test_timer.py
wkschwartz/shutdown
0
6632822
<reponame>wkschwartz/shutdown # © 2018, <NAME>. All rights reserved. See the LICENSE file. import os import signal import sys import time import unittest from wrapitup import request, reset, Timer class TestTimer(unittest.TestCase): # Python makes few guarantees about the precision of its various clocks. # https...
# © 2018, <NAME>. All rights reserved. See the LICENSE file. import os import signal import sys import time import unittest from wrapitup import request, reset, Timer class TestTimer(unittest.TestCase): # Python makes few guarantees about the precision of its various clocks. # https://stackoverflow.com/a/4377378...
en
0.927071
# © 2018, <NAME>. All rights reserved. See the LICENSE file. # Python makes few guarantees about the precision of its various clocks. # https://stackoverflow.com/a/43773780 # Pypy seems to have occasional time-out problems on a first run but runs # okay on the second run. Slowing down time seems to help on the first ru...
2.552399
3
gallon.py
chlbnd/eureciclo
0
6632823
from bottle import Bottle from itertools import combinations class Gallon: def __init__(self, gallons): self.__gallons = gallons self.__liters = gallons if isinstance(gallons, list): self.__liters = sum(gallons) @property def gallons(self): return self.__gallo...
from bottle import Bottle from itertools import combinations class Gallon: def __init__(self, gallons): self.__gallons = gallons self.__liters = gallons if isinstance(gallons, list): self.__liters = sum(gallons) @property def gallons(self): return self.__gallo...
none
1
3.083138
3
aries_cloudagent/wallet/tests/test_indy_wallet.py
msembinelli/aries-cloudagent-python
1
6632824
import base64 import json import os import pytest from asynctest import mock as async_mock from asynctest import TestCase as AsyncTestCase import indy.anoncreds import indy.crypto import indy.did import indy.wallet from aries_cloudagent.wallet.basic import BasicWallet from aries_cloudagent.wallet.indy import IndyWal...
import base64 import json import os import pytest from asynctest import mock as async_mock from asynctest import TestCase as AsyncTestCase import indy.anoncreds import indy.crypto import indy.did import indy.wallet from aries_cloudagent.wallet.basic import BasicWallet from aries_cloudagent.wallet.indy import IndyWal...
en
0.771409
# much slower tests with argon-hashed keys Apply all BasicWallet tests against IndyWallet @pytest.mark.asyncio async def test_catpol(self, wallet): with pytest.raises(test_module.WalletError): await wallet.get_credential_definition_tag_policy("cred-def-id") # invalid CD_ID = f"{self.te...
2.022673
2
Table4/streamsdemo/app.py
thomasmilner/ddbgsidemo
1
6632825
<gh_stars>1-10 import json import boto3 import traceback from botocore.exceptions import ClientError def updateDDBTable(tableName,pkValue,team,counter): dynamodb = boto3.resource('dynamodb') #Get table name from stream. Updates will be written back to same table dynamodb_table = dynamodb.Table(tableN...
import json import boto3 import traceback from botocore.exceptions import ClientError def updateDDBTable(tableName,pkValue,team,counter): dynamodb = boto3.resource('dynamodb') #Get table name from stream. Updates will be written back to same table dynamodb_table = dynamodb.Table(tableName) #...
en
0.639995
#Get table name from stream. Updates will be written back to same table #loop through collection #if record doesn't exist, create it #new record will be created with 0 + num value #persist changes to table # INSERT, MODIFY, REMOVE #print(keyValue) #if (event_name == 'REMOVE') and "sales_cnt" not in record['dynamodb']["...
2.363498
2
src/precise_nlp/const/path.py
kpwhri/precise_nlp
0
6632826
""" Variable overview: If a total, then divided by <3, 3+ Otherwise, yes=1, no=0 """ # adenoma detected ADENOMA_STATUS = 'adenoma_status' ADENOMA_STATUS_ADV = 'adenoma_status_adv' ADENOMA_DISTAL = 'adenoma_distal' ADENOMA_DISTAL_COUNT = 'adenoma_distal_count' ADENOMA_PROXIMAL = 'adenoma_proximal' ADENOMA_PROXIMAL_COUN...
""" Variable overview: If a total, then divided by <3, 3+ Otherwise, yes=1, no=0 """ # adenoma detected ADENOMA_STATUS = 'adenoma_status' ADENOMA_STATUS_ADV = 'adenoma_status_adv' ADENOMA_DISTAL = 'adenoma_distal' ADENOMA_DISTAL_COUNT = 'adenoma_distal_count' ADENOMA_PROXIMAL = 'adenoma_proximal' ADENOMA_PROXIMAL_COUN...
en
0.648924
Variable overview: If a total, then divided by <3, 3+ Otherwise, yes=1, no=0 # adenoma detected # tubulovillous adenoma detected # tubular adenoma detected # villous adenoma detected (not tubulovillous) # either villous or tubulovillous adenoma detected # high-grade dysplasia detected # number of adenomas found # has ...
1.675837
2
IRIS_data_download/IRIS_download_support/obspy/signal/_sosfilt.py
earthinversion/Fnet_IRIS_data_automated_download
2
6632827
<gh_stars>1-10 #!/usr/bin/env python # -*- coding: utf-8 -*- # ---------------------------------------------------------------------- # Filename: _sosfilt.py # Purpose: Backport of Second-Order Section Filtering from SciPy 0.16.0 # Author: <NAME> + SciPy authors # ----------------------------------------------------...
#!/usr/bin/env python # -*- coding: utf-8 -*- # ---------------------------------------------------------------------- # Filename: _sosfilt.py # Purpose: Backport of Second-Order Section Filtering from SciPy 0.16.0 # Author: <NAME> + SciPy authors # -------------------------------------------------------------------...
en
0.783971
#!/usr/bin/env python # -*- coding: utf-8 -*- # ---------------------------------------------------------------------- # Filename: _sosfilt.py # Purpose: Backport of Second-Order Section Filtering from SciPy 0.16.0 # Author: <NAME> + SciPy authors # -------------------------------------------------------------------...
2.323811
2
example/migrations/0001_initial.py
tim-mccurrach/django-s3-upload
26
6632828
# Generated by Django 3.1 on 2020-08-25 12:15 import django.db.models.deletion from django.db import migrations, models import s3upload.fields class Migration(migrations.Migration): initial = True dependencies = [] operations = [ migrations.CreateModel( name="Cat", fie...
# Generated by Django 3.1 on 2020-08-25 12:15 import django.db.models.deletion from django.db import migrations, models import s3upload.fields class Migration(migrations.Migration): initial = True dependencies = [] operations = [ migrations.CreateModel( name="Cat", fie...
en
0.751062
# Generated by Django 3.1 on 2020-08-25 12:15
1.714233
2
samples/model-builder/create_batch_prediction_job_sample_test.py
dizcology/python-aiplatform
180
6632829
<gh_stars>100-1000 # Copyright 2021 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
# Copyright 2021 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
en
0.859583
# Copyright 2021 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
1.934279
2
python_autocomplete/dataset/__init__.py
wwnew/python_autocomplete
116
6632830
<filename>python_autocomplete/dataset/__init__.py<gh_stars>100-1000 import string from typing import Dict, List, Tuple ID_CHARS = set(string.ascii_letters + string.digits + '_') class Tokenizer: n_tokens: int itos: List[str] stoi: Dict[str, int] is_trained: int def encode(self, data: str, *, is_...
<filename>python_autocomplete/dataset/__init__.py<gh_stars>100-1000 import string from typing import Dict, List, Tuple ID_CHARS = set(string.ascii_letters + string.digits + '_') class Tokenizer: n_tokens: int itos: List[str] stoi: Dict[str, int] is_trained: int def encode(self, data: str, *, is_...
none
1
2.741866
3
python/FindAllAnagramsinaString.py
JumHorn/leetcode
1
6632831
<gh_stars>1-10 from typing import List class Solution: def findAnagrams(self, s: str, p: str) -> List[int]: shash, phash, res = [0] * 26, [0] * 26, [] slen, plen = len(s), len(p) if slen < plen: return res for c in p: phash[ord(c) - ord('a')] += 1 fo...
from typing import List class Solution: def findAnagrams(self, s: str, p: str) -> List[int]: shash, phash, res = [0] * 26, [0] * 26, [] slen, plen = len(s), len(p) if slen < plen: return res for c in p: phash[ord(c) - ord('a')] += 1 for i in range(pl...
none
1
3.212631
3
olympic_games/migrations/0002_auto_20190514_2130.py
PircK/OPB
0
6632832
<gh_stars>0 # Generated by Django 2.2.1 on 2019-05-14 21:30 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('olympic_games', '0001_initial'), ] operations = [ ]
# Generated by Django 2.2.1 on 2019-05-14 21:30 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('olympic_games', '0001_initial'), ] operations = [ ]
en
0.731575
# Generated by Django 2.2.1 on 2019-05-14 21:30
1.343032
1
tensorflow_lattice/python/pwl_calibration_lib.py
liar7252/lattice
0
6632833
<filename>tensorflow_lattice/python/pwl_calibration_lib.py # Copyright 2019 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 # # ...
<filename>tensorflow_lattice/python/pwl_calibration_lib.py # Copyright 2019 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 # # ...
en
0.834779
# Copyright 2019 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 agreed to in writing, ...
2.295175
2
JumpscaleLibsExtra/tools/threefold_simulation/notebooks/hardware/supermicro_compute.py
threefoldtech/jumpscaleX_libs_extra
1
6632834
from Jumpscale import j # as used in bancadati farm, compute frontend to archive def bom_calc(environment): from hardware.components.components_supermicro import bom_populate environment.bom = bom_populate(environment.bom) # see the bill of material sheet to define the devices # we get a device st...
from Jumpscale import j # as used in bancadati farm, compute frontend to archive def bom_calc(environment): from hardware.components.components_supermicro import bom_populate environment.bom = bom_populate(environment.bom) # see the bill of material sheet to define the devices # we get a device st...
en
0.833211
# as used in bancadati farm, compute frontend to archive # see the bill of material sheet to define the devices # we get a device starting from a template # the switch added to the node # an environment to simulate the overhead per node (eg. 1 switch per node)
2.491335
2
libraries/botbuilder-ai/botbuilder/ai/qna/models/ranker_types.py
Fl4v/botbuilder-python
388
6632835
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. class RankerTypes: """ Default Ranker Behaviour. i.e. Ranking based on Questions and Answer. """ DEFAULT = "Default" """ Ranker based on question Only. """ QUESTION_ONLY = "QuestionOnly" """ Ranker ba...
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. class RankerTypes: """ Default Ranker Behaviour. i.e. Ranking based on Questions and Answer. """ DEFAULT = "Default" """ Ranker based on question Only. """ QUESTION_ONLY = "QuestionOnly" """ Ranker ba...
en
0.935715
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. Default Ranker Behaviour. i.e. Ranking based on Questions and Answer. Ranker based on question Only. Ranker based on Autosuggest for question field only.
1.55711
2
asv/console.py
jni/asv
0
6632836
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ A set of utilities for writing output to the console. """ from __future__ import (absolute_import, division, print_function, unicode_literals) import io import codecs import contextlib import locale im...
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ A set of utilities for writing output to the console. """ from __future__ import (absolute_import, division, print_function, unicode_literals) import io import codecs import contextlib import locale im...
en
0.769586
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst A set of utilities for writing output to the console. Returns `True` if `file` is a tty. Most built-in Python file-like objects have an `isatty` member, but some user-defined types may not, so this assumes those are not ...
3.233775
3
controller/annotations.py
euxhenh/cellar
0
6632837
import dash import numpy as np from dash.dependencies import Input, Output, State from dash.exceptions import PreventUpdate from app import app, dbroot, logger from .multiplexer import MultiplexerOutput from .notifications import _prep_notification def _fill_annotation(adata, cluster_id, value): """ Set the ...
import dash import numpy as np from dash.dependencies import Input, Output, State from dash.exceptions import PreventUpdate from app import app, dbroot, logger from .multiplexer import MultiplexerOutput from .notifications import _prep_notification def _fill_annotation(adata, cluster_id, value): """ Set the ...
en
0.786363
Set the annotation for all points with label 'cluster_id' to 'value'. Return a table of annotations based on the keys obs['labels'] and obs['annotations']. Only the clusters for which annotations exist (i.e., != "") will be displayed. # Need labels and annotations keys to be populated # logger.warn("No ...
2.19364
2
pytar/__init__.py
douglas-archives/pytar
0
6632838
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = '<NAME>' __email__ = '<EMAIL>' __version__ = '0.1.0.dev2'
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = '<NAME>' __email__ = '<EMAIL>' __version__ = '0.1.0.dev2'
en
0.352855
#!/usr/bin/env python # -*- coding: utf-8 -*-
1.023668
1
glue_genomics_viewers/genome_track/qt/data_viewer.py
gluesolutions/glue-genomics-viewers
0
6632839
import logging import os from echo import delay_callback from matplotlib.axes._base import _TransformedBoundsLocator import numpy as np import pandas as pd from glue.core import Subset from glue.utils import nonpartial, defer_draw, decorate_all_methods from glue.viewers.matplotlib.qt.data_viewer import MatplotlibDataV...
import logging import os from echo import delay_callback from matplotlib.axes._base import _TransformedBoundsLocator import numpy as np import pandas as pd from glue.core import Subset from glue.utils import nonpartial, defer_draw, decorate_all_methods from glue.viewers.matplotlib.qt.data_viewer import MatplotlibDataV...
en
0.87334
# empty dataset # Update view bounds on first layer #Annotations over very large regions are slow and illegible Reorder each track top->bottom sorted by zorder, removing any gaps of non-visible tracks.
1.833156
2
api/tacticalrmm/alerts/migrations/0001_initial.py
infinite8co/tacticalrmm
903
6632840
# Generated by Django 3.1 on 2020-08-15 15:31 import django.db.models.deletion from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ("agents", "0012_auto_20200810_0544"), ] operations = [ migrations.CreateModel( ...
# Generated by Django 3.1 on 2020-08-15 15:31 import django.db.models.deletion from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ("agents", "0012_auto_20200810_0544"), ] operations = [ migrations.CreateModel( ...
en
0.81096
# Generated by Django 3.1 on 2020-08-15 15:31
1.648244
2
teuthology/task/clock.py
julpark-rh/teuthology
117
6632841
<reponame>julpark-rh/teuthology<filename>teuthology/task/clock.py<gh_stars>100-1000 """ Clock synchronizer """ import logging import contextlib from teuthology.orchestra import run log = logging.getLogger(__name__) @contextlib.contextmanager def task(ctx, config): """ Sync or skew clock This will initia...
""" Clock synchronizer """ import logging import contextlib from teuthology.orchestra import run log = logging.getLogger(__name__) @contextlib.contextmanager def task(ctx, config): """ Sync or skew clock This will initially sync the clocks. Eventually it should let us also skew by some number of se...
en
0.73688
Clock synchronizer Sync or skew clock This will initially sync the clocks. Eventually it should let us also skew by some number of seconds. example:: tasks: - clock: - ceph: - interactive: to sync. :param ctx: Context :param config: Configuration Run ntpq at...
2.837746
3
addvalue_id.py
Theropod/seaice-data-web-visualization
0
6632842
<reponame>Theropod/seaice-data-web-visualization import json inputGeojson='./asi-AMSR2-n6250-20141201-v5.4.reprojected.geo.json' outputGeojson='asi-AMSR2-n6250-20141201-v5.4.reprojected_values.geo.json' with open(inputGeojson, 'r') as f: gdal_json = json.load(f) i=0 for feature in gdal_json["features"]: ...
import json inputGeojson='./asi-AMSR2-n6250-20141201-v5.4.reprojected.geo.json' outputGeojson='asi-AMSR2-n6250-20141201-v5.4.reprojected_values.geo.json' with open(inputGeojson, 'r') as f: gdal_json = json.load(f) i=0 for feature in gdal_json["features"]: feature["id"]=i i+=1 feature["value...
none
1
2.450126
2
bin/bin_onePT/extra/mivr-4-fit-zAll.py
JohanComparat/nbody-npt-functions
4
6632843
import glob import sys import cPickle from os.path import join import numpy as n import astropy.io.fits as fits import os import matplotlib #matplotlib.use('pdf') matplotlib.rcParams['font.size']=12 import matplotlib.pyplot as p from scipy.optimize import minimize dir='..' dir_04 = join(dir,"MD_0.4Gpc") dir_10 = join...
import glob import sys import cPickle from os.path import join import numpy as n import astropy.io.fits as fits import os import matplotlib #matplotlib.use('pdf') matplotlib.rcParams['font.size']=12 import matplotlib.pyplot as p from scipy.optimize import minimize dir='..' dir_04 = join(dir,"MD_0.4Gpc") dir_10 = join...
en
0.342936
#matplotlib.use('pdf') Plots the data to be used in the fits later in the analysis. # redshift selection # mass selection #| ((data["boxLength"]==2500.)&(data["log_"+qty+"_min"]>n.log10(limits_25[0]))) | ((data["boxLength"]==4000.)&(data["log_"+qty+"_min"]>n.log10(limits_40[0]))) # minimum number counts selection # dat...
1.904563
2
gae_mini_profiler/unformatter/__init__.py
danieldanciu/schoggi
481
6632844
<filename>gae_mini_profiler/unformatter/__init__.py<gh_stars>100-1000 import pprint import re import sys _STRING = re.compile(r"^\s*(['\"])") _NUMBER = re.compile(r"^\s*(\d+L?)\s*") _BOOLEAN = re.compile(r"^\s*(True|False)\s*") _DETAILS_OMMITTED = re.compile(r"^\s*\.\.\.\s*") _LIST = re.compile(r"^\s*\[") _LIST_SEPAR...
<filename>gae_mini_profiler/unformatter/__init__.py<gh_stars>100-1000 import pprint import re import sys _STRING = re.compile(r"^\s*(['\"])") _NUMBER = re.compile(r"^\s*(\d+L?)\s*") _BOOLEAN = re.compile(r"^\s*(True|False)\s*") _DETAILS_OMMITTED = re.compile(r"^\s*\.\.\.\s*") _LIST = re.compile(r"^\s*\[") _LIST_SEPAR...
none
1
2.308692
2
pymono/models/Player.py
MrKomish/pymono
1
6632845
class Player: def __init__(self, color): self.color = color self.cell_index = 0 self.money = 1500 self.is_current = False self.freeze_turns_left = 0 self.is_in_jail = False
class Player: def __init__(self, color): self.color = color self.cell_index = 0 self.money = 1500 self.is_current = False self.freeze_turns_left = 0 self.is_in_jail = False
none
1
2.516388
3
umm/cli/umm.py
zachcoleman/umm-cli-bot
0
6632846
import subprocess from typing import List import click import requests from pygments import console from umm.cli.client import add_request, confirm_request, umm_request from umm.server.__main__ import main @click.command() @click.option("--start", "-s", is_flag=True) @click.option("--add", is_flag=True) @click.argu...
import subprocess from typing import List import click import requests from pygments import console from umm.cli.client import add_request, confirm_request, umm_request from umm.server.__main__ import main @click.command() @click.option("--start", "-s", is_flag=True) @click.option("--add", is_flag=True) @click.argu...
en
0.735051
Args: start: add: tags: Returns: None # continue and exit conditions # no candidate command selected found # if command has prompts # build command # get action
2.883229
3
vmaig_auth/forms.py
a1401358759/vmaig_blog
1
6632847
# -*- coding: utf-8 -*- from django import forms from vmaig_auth.models import VmaigUser from django.contrib.auth.tokens import default_token_generator from django.contrib.sites.models import get_current_site from django.utils.http import urlsafe_base64_encode from django.utils.encoding import force_bytes from django.c...
# -*- coding: utf-8 -*- from django import forms from vmaig_auth.models import VmaigUser from django.contrib.auth.tokens import default_token_generator from django.contrib.sites.models import get_current_site from django.utils.http import urlsafe_base64_encode from django.utils.encoding import force_bytes from django.c...
zh
0.521661
# -*- coding: utf-8 -*- # 参考自django.contrib.auth.forms.UserCreationForm # 错误信息 # 错误信息 invalid 表示username不合法的错误信息, # required 表示没填的错误信息 # Since User.username is unique, this check is redundant, # but it sets a nicer error message than the ORM. See #13147. # 判断是这个email 用户是否存在 # 错误信息 # 错误信息 invalid 表示username不合法的错误信息, # r...
2.238331
2
caniusepython3/pylint_checker.py
macleodbroad-wf/caniusepython3
276
6632848
# Copyright 2014 Google Inc. All rights reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agre...
# Copyright 2014 Google Inc. All rights reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agre...
en
0.804327
# Copyright 2014 Google Inc. All rights reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed ...
1.982241
2
wikis/urls.py
aristo-master/uzuwiki
0
6632849
"""uzuwiki URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.0/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-based...
"""uzuwiki URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.0/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-based...
en
0.544413
uzuwiki URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.0/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-based vi...
2.610378
3
shortener/models.py
mariob0y/URLshortener
1
6632850
<gh_stars>1-10 from django.db import models from django.conf import settings class UrlMap(models.Model): '''Storing of full and short URL''' user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE) full_url = models.CharField(max_length=500) short_url =...
from django.db import models from django.conf import settings class UrlMap(models.Model): '''Storing of full and short URL''' user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE) full_url = models.CharField(max_length=500) short_url = models.CharFie...
en
0.769665
Storing of full and short URL Settings for URS shortening usage
2.194466
2