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
Py Learning/15. My Final Project/StudentDB.py
MahmudX/TestSharp
0
6630151
import sqlite3 import os db = sqlite3.connect('studentDB.db') cursor = db.cursor() cursor.execute("""CREATE TABLE IF NOT EXISTS studentDB( ID INTEGER PRIMARY KEY, Name TEXT, District TEXT, 'Blood Group' TEXT )""") cursor.execute( ''' SELECT * FROM sqlite_master WHERE type...
import sqlite3 import os db = sqlite3.connect('studentDB.db') cursor = db.cursor() cursor.execute("""CREATE TABLE IF NOT EXISTS studentDB( ID INTEGER PRIMARY KEY, Name TEXT, District TEXT, 'Blood Group' TEXT )""") cursor.execute( ''' SELECT * FROM sqlite_master WHERE type...
en
0.436431
CREATE TABLE IF NOT EXISTS studentDB( ID INTEGER PRIMARY KEY, Name TEXT, District TEXT, 'Blood Group' TEXT ) SELECT * FROM sqlite_master WHERE type='table' AND name='studentDB' INSERT INTO studentDB (ID, Name, District, 'Blood Group') VALUES ('{sID}{sPo}','{sNAME}','{sDIS}', '{sBG}')
4.076909
4
Bases/Theory/2 - operators.py
PierreAnken/TrainingPython
0
6630152
<filename>Bases/Theory/2 - operators.py if __name__ == '__main__': print(True) print(3 < 5) if 3 > 2: print('x') my_list = ['2'] my_empty_list = [] if my_empty_list: print('List is not empty') else: print('List is empty') # arithmetics print(' == Operateu...
<filename>Bases/Theory/2 - operators.py if __name__ == '__main__': print(True) print(3 < 5) if 3 > 2: print('x') my_list = ['2'] my_empty_list = [] if my_empty_list: print('List is not empty') else: print('List is empty') # arithmetics print(' == Operateu...
en
0.609876
# arithmetics # assigement # comparison # operateurs logiques # identity operators # classes # membership operator
3.836324
4
train.py
limpidezza/DeepSpeech
0
6630153
<filename>train.py """Trainer for DeepSpeech2 model.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import argparse import functools import io from model_utils.model import DeepSpeech2Model from model_utils.model_check import check_cuda, check_version fr...
<filename>train.py """Trainer for DeepSpeech2 model.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import argparse import functools import io from model_utils.model import DeepSpeech2Model from model_utils.model_check import check_cuda, check_version fr...
en
0.637891
Trainer for DeepSpeech2 model. # yapf: disable # batch for printing " # batch for save checkpoint and modle params ") # yapf: disable DeepSpeech2 training. # check if set use_gpu=True in paddlepaddle cpu version # check if paddlepaddle version is satisfied
2.515664
3
tests/template_tests/filter_tests/test_truncatewords_html.py
Fak3/django
19
6630154
from django.template.defaultfilters import truncatewords_html from django.test import SimpleTestCase class FunctionTests(SimpleTestCase): def test_truncate_zero(self): self.assertEqual(truncatewords_html('<p>one <a href="#">two - three <br>four</a> five</p>', 0), '') def test_truncate(self): ...
from django.template.defaultfilters import truncatewords_html from django.test import SimpleTestCase class FunctionTests(SimpleTestCase): def test_truncate_zero(self): self.assertEqual(truncatewords_html('<p>one <a href="#">two - three <br>four</a> five</p>', 0), '') def test_truncate(self): ...
fr
0.235888
#x00bf;C&oacute;mo est&aacute;?</i>', 3), #x00bf;C&oacute;mo …</i>',
2.469225
2
src/lobbyist/library/error.py
chpatton013/lobbyist
0
6630155
<filename>src/lobbyist/library/error.py from typing import Any, Dict, Set, Tuple class HttpError(Exception): def __init__( self, code: int, name: str, description: str, context: Dict[str, str] = {}, ): super().__init__(code, description) self.code = code...
<filename>src/lobbyist/library/error.py from typing import Any, Dict, Set, Tuple class HttpError(Exception): def __init__( self, code: int, name: str, description: str, context: Dict[str, str] = {}, ): super().__init__(code, description) self.code = code...
none
1
2.472145
2
setup.py
ryonsherman/noise
0
6630156
#!/usr/bin/env python2 __author__ = "<NAME>" __email__ = "<EMAIL>" __copyright__ = "Copyright 2014-2015, <NAME>" __license__ = "MIT" __version__ = "1.0" # setup version import os, sys from setuptools import setup # get app version sys.path.insert(0, os.path.join(os.path.dirname(__file__), "src")) from noi...
#!/usr/bin/env python2 __author__ = "<NAME>" __email__ = "<EMAIL>" __copyright__ = "Copyright 2014-2015, <NAME>" __license__ = "MIT" __version__ = "1.0" # setup version import os, sys from setuptools import setup # get app version sys.path.insert(0, os.path.join(os.path.dirname(__file__), "src")) from noi...
en
0.337867
#!/usr/bin/env python2 # setup version # get app version # app version # perform setup #long_description=open('README.md').read(), #install_requires=[],
1.617235
2
website/events/ssr_views.py
abecede753/trax
0
6630157
import random import datetime from django.conf import settings from django.contrib import messages from django import forms from django.contrib.auth.decorators import login_required from django.http import Http404 from django.http import JsonResponse from django.urls import reverse from django.utils.decorators import ...
import random import datetime from django.conf import settings from django.contrib import messages from django import forms from django.contrib.auth.decorators import login_required from django.http import Http404 from django.http import JsonResponse from django.urls import reverse from django.utils.decorators import ...
none
1
1.994246
2
ohlc/__main__.py
ubunatic/ohlc
29
6630158
<gh_stars>10-100 from ohlc.candles.app import main main()
from ohlc.candles.app import main main()
none
1
1.040327
1
dltb/base/image.py
Petr-By/qtpyvis
3
6630159
"""Defintion of abstract classes for image handling. The central data structure is :py:class:`Image`, a subclass of :py:class:`Data`, specialized to work with images. It provides, for example, properties like size and channels. Relation to other `image` modules in the Deep Learning ToolBox: * :py:mod:`dltb.util.ima...
"""Defintion of abstract classes for image handling. The central data structure is :py:class:`Image`, a subclass of :py:class:`Data`, specialized to work with images. It provides, for example, properties like size and channels. Relation to other `image` modules in the Deep Learning ToolBox: * :py:mod:`dltb.util.ima...
en
0.78523
Defintion of abstract classes for image handling. The central data structure is :py:class:`Image`, a subclass of :py:class:`Data`, specialized to work with images. It provides, for example, properties like size and channels. Relation to other `image` modules in the Deep Learning ToolBox: * :py:mod:`dltb.util.image`...
3.316097
3
TraitsUI/examples/HDF5_tree_demo_using_h5py.py
marshallmcdonnell/interactive_plotting
0
6630160
"""This demo shows how to use Traits TreeEditors with PyTables to walk the heirarchy of an HDF5 file. This only picks out arrays and groups, but could easily be extended to other structures, like tables. In the demo, the path to the selected item is printed whenever the selection changes. In order to run, a path to ...
"""This demo shows how to use Traits TreeEditors with PyTables to walk the heirarchy of an HDF5 file. This only picks out arrays and groups, but could easily be extended to other structures, like tables. In the demo, the path to the selected item is printed whenever the selection changes. In order to run, a path to ...
en
0.85452
This demo shows how to use Traits TreeEditors with PyTables to walk the heirarchy of an HDF5 file. This only picks out arrays and groups, but could easily be extended to other structures, like tables. In the demo, the path to the selected item is printed whenever the selection changes. In order to run, a path to an ...
2.888122
3
BioSTEAM 2.x.x/biorefineries/actag/_units.py
yoelcortes/Bioindustrial-Complex
2
6630161
# -*- coding: utf-8 -*- """ """ import biosteam as bst from thermosteam import PRxn, Rxn __all__ = ('OleinCrystallizer', 'Fermentation') class OleinCrystallizer(bst.BatchCrystallizer): def __init__(self, ID='', ins=None, outs=(), thermo=None, *, T, crystal_TAG_purity=0.95, melt_AcTAG_purity...
# -*- coding: utf-8 -*- """ """ import biosteam as bst from thermosteam import PRxn, Rxn __all__ = ('OleinCrystallizer', 'Fermentation') class OleinCrystallizer(bst.BatchCrystallizer): def __init__(self, ID='', ins=None, outs=(), thermo=None, *, T, crystal_TAG_purity=0.95, melt_AcTAG_purity...
en
0.835336
# -*- coding: utf-8 -*- # Lever rule
2.159739
2
server.py
maneeshd/expensifier
2
6630162
<filename>server.py """ Author: <NAME> <<EMAIL>> Server for expensifier using Flask + Flask-Compress middleware """ from os import urandom from os.path import join, realpath, dirname from flask import Flask, send_file from flask_compress import Compress # Directories for the app CUR_DIR = realpath(dirname(__file__))...
<filename>server.py """ Author: <NAME> <<EMAIL>> Server for expensifier using Flask + Flask-Compress middleware """ from os import urandom from os.path import join, realpath, dirname from flask import Flask, send_file from flask_compress import Compress # Directories for the app CUR_DIR = realpath(dirname(__file__))...
en
0.644251
Author: <NAME> <<EMAIL>> Server for expensifier using Flask + Flask-Compress middleware # Directories for the app # App creation & configuration # Development Server, Run using Gunicorn in production
2.509157
3
typewriter.py
john-pettigrew/noisy_typewriter
0
6630163
#!/usr/bin/env python3 import time from Xlib.display import Display import os from subprocess import Popen def play_sound(file): Popen(['mplayer', file]) disp = Display() empty_keys = [0] * 32 return_key = ([0] * 4) + [16] + ([0] * 27) last_keys = [0] * 32 while 1: keys = disp.query_keymap() if keys != ...
#!/usr/bin/env python3 import time from Xlib.display import Display import os from subprocess import Popen def play_sound(file): Popen(['mplayer', file]) disp = Display() empty_keys = [0] * 32 return_key = ([0] * 4) + [16] + ([0] * 27) last_keys = [0] * 32 while 1: keys = disp.query_keymap() if keys != ...
fr
0.221828
#!/usr/bin/env python3
2.755546
3
parslr/__main__.py
maximmenshikov/parslr
0
6630164
import sys import os from parslr.Parslr import Parslr from parslr.parslr_args import prepare_parser args = prepare_parser().parse_args() p = Parslr(args.antlr, args.tmp_path) ret_val = p.generate_parser(args.grammar) if ret_val != 0: print("Failed to generate parser") sys.exit(ret_val) ret_val = p.compile() if...
import sys import os from parslr.Parslr import Parslr from parslr.parslr_args import prepare_parser args = prepare_parser().parse_args() p = Parslr(args.antlr, args.tmp_path) ret_val = p.generate_parser(args.grammar) if ret_val != 0: print("Failed to generate parser") sys.exit(ret_val) ret_val = p.compile() if...
en
0.863063
# A directory with cases # Just one file
2.523848
3
rioxarray/rioxarray.py
TomAugspurger/rioxarray
0
6630165
# -- coding: utf-8 -- """ This module is an extension for xarray to provide rasterio capabilities to xarray datasets/dataarrays. Credits: The `reproject` functionality was adopted from https://github.com/opendatacube/datacube-core # noqa Source file: - https://github.com/opendatacube/datacube-core/blob/084c84d78cb6e1...
# -- coding: utf-8 -- """ This module is an extension for xarray to provide rasterio capabilities to xarray datasets/dataarrays. Credits: The `reproject` functionality was adopted from https://github.com/opendatacube/datacube-core # noqa Source file: - https://github.com/opendatacube/datacube-core/blob/084c84d78cb6e1...
en
0.582948
# -- coding: utf-8 -- This module is an extension for xarray to provide rasterio capabilities to xarray datasets/dataarrays. Credits: The `reproject` functionality was adopted from https://github.com/opendatacube/datacube-core # noqa Source file: - https://github.com/opendatacube/datacube-core/blob/084c84d78cb6e1326c...
2.177851
2
sktime/_contrib/classifier_capabilities_table.py
OliverMatthews/sktime
1
6630166
<gh_stars>1-10 # -*- coding: utf-8 -*- """Auto-generate a classifier capabilites summary.""" import pandas as pd from sktime.registry import all_estimators # List of columns in the table df_columns = [ "Classifier Category", "Classifier Name", "multivariate", "unequal_length", "missing_values", ...
# -*- coding: utf-8 -*- """Auto-generate a classifier capabilites summary.""" import pandas as pd from sktime.registry import all_estimators # List of columns in the table df_columns = [ "Classifier Category", "Classifier Name", "multivariate", "unequal_length", "missing_values", "train_estima...
en
0.657981
# -*- coding: utf-8 -*- Auto-generate a classifier capabilites summary. # List of columns in the table # creates dataframe as df # Loop through all the classifiers # capabilites of each of the classifier classifier # Adding capabilites for each classifier in the table
2.71586
3
gimmemotifs/commands/motif2factors.py
simonvh/gimmemotifs
20
6630167
<filename>gimmemotifs/commands/motif2factors.py # Copyright (c) 2009-2021 <NAME> <<EMAIL>> # # This module is free software. You can redistribute it and/or modify it under # the terms of the MIT License, see the file COPYING included with this # distribution. from gimmemotifs.orthologs import motif2factor_from_ortholog...
<filename>gimmemotifs/commands/motif2factors.py # Copyright (c) 2009-2021 <NAME> <<EMAIL>> # # This module is free software. You can redistribute it and/or modify it under # the terms of the MIT License, see the file COPYING included with this # distribution. from gimmemotifs.orthologs import motif2factor_from_ortholog...
en
0.77257
# Copyright (c) 2009-2021 <NAME> <<EMAIL>> # # This module is free software. You can redistribute it and/or modify it under # the terms of the MIT License, see the file COPYING included with this # distribution.
1.910374
2
contrib/node/src/python/pants/contrib/node/subsystems/eslint.py
mpopenko-exos/pants
0
6630168
<reponame>mpopenko-exos/pants<filename>contrib/node/src/python/pants/contrib/node/subsystems/eslint.py # Copyright 2020 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import filecmp import logging import os.path import shutil from typing import Tuple ...
# Copyright 2020 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import filecmp import logging import os.path import shutil from typing import Tuple from pants.option.custom_types import dir_option, file_option from pants.subsystem.subsystem import Sub...
en
0.75201
# Copyright 2020 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). Returns the path where the ESLint is bootstrapped. :param task_workdir: The task's working directory :returns: The path where ESLint is bootstrapped and whether or not it is config...
1.74229
2
causal_discovery/multivariable_mlp.py
codeaudit/ENCO
0
6630169
import torch import torch.nn as nn import math import numpy as np class MultivarMLP(nn.Module): def __init__(self, input_dims, hidden_dims, output_dims, extra_dims, actfn, pre_layers=None): """ Module for stacking N neural networks in parallel for more efficient evaluation. In the context ...
import torch import torch.nn as nn import math import numpy as np class MultivarMLP(nn.Module): def __init__(self, input_dims, hidden_dims, output_dims, extra_dims, actfn, pre_layers=None): """ Module for stacking N neural networks in parallel for more efficient evaluation. In the context ...
en
0.801981
Module for stacking N neural networks in parallel for more efficient evaluation. In the context of ENCO, we stack the neural networks of the conditional distributions for all N variables on top of each other to parallelize it on a GPU. Parameters ---------- input_dims : int ...
3.229416
3
pangram.py
sara-02/dsa_sg
0
6630170
# Pangram example # The quick brown fox jumps over the lazy dog def check_pangram(string): NUM_APLHA = 26 if len(string) < NUM_APLHA: return "String is Not a pangram." bucket_count = [0] * NUM_APLHA st = string.lower() for s in st: if s.isalpha(): bucket_count[ord(s) -...
# Pangram example # The quick brown fox jumps over the lazy dog def check_pangram(string): NUM_APLHA = 26 if len(string) < NUM_APLHA: return "String is Not a pangram." bucket_count = [0] * NUM_APLHA st = string.lower() for s in st: if s.isalpha(): bucket_count[ord(s) -...
en
0.641493
# Pangram example # The quick brown fox jumps over the lazy dog
4.029597
4
src/datasets/SingleFolderDataset.py
smmmmi/E2SRI
35
6630171
import os from .BaseDataset import BaseDataset from PIL import Image class SingleFolderDataset(BaseDataset): def __init__(self, root, cfg, is_train=True): super(SingleFolderDataset, self).__init__(cfg, is_train) root = os.path.abspath(root) self.file_list = sorted(os.listdir(root)) ...
import os from .BaseDataset import BaseDataset from PIL import Image class SingleFolderDataset(BaseDataset): def __init__(self, root, cfg, is_train=True): super(SingleFolderDataset, self).__init__(cfg, is_train) root = os.path.abspath(root) self.file_list = sorted(os.listdir(root)) ...
none
1
2.60012
3
main.py
iamabhishek229313/capstone_project_backend
0
6630172
<reponame>iamabhishek229313/capstone_project_backend<filename>main.py from typing import Optional from fastapi import FastAPI from enum import Enum app = FastAPI() @app.get("/") async def read_root(): return {"Hello": "world"} # we can return a dict, list, singular values as str, int, etc. @app.ge...
from typing import Optional from fastapi import FastAPI from enum import Enum app = FastAPI() @app.get("/") async def read_root(): return {"Hello": "world"} # we can return a dict, list, singular values as str, int, etc. @app.get("/items/{item_id}") async def read_item(item_id: int, q: Optional[s...
en
0.828529
# we can return a dict, list, singular values as str, int, etc.
2.786028
3
endrpi/routes/pin.py
persanix-llc/endrpi-server
2
6630173
<gh_stars>1-10 # Copyright (c) 2020 - 2021 Persanix LLC. 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 # # Unle...
# Copyright (c) 2020 - 2021 Persanix LLC. 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.815656
# Copyright (c) 2020 - 2021 Persanix LLC. 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 ...
1.906995
2
src/metadata.py
aditya-shri/libback
0
6630174
import datetime import json import os import re import time import requests import src.tree import src.walk def parseMovie(name): reg_1 = r'^[\(\[\{](?P<year>\d{4})[\)\]\}]\s(?P<title>[^.]+).*(?P<extention>\..*)?$' # (2008) Iron Man.mkv reg_2 = r'^(?P<title>.*)\s[\(\[\{](?P<year>\d{4})[\)\]\}].*(?P<extentio...
import datetime import json import os import re import time import requests import src.tree import src.walk def parseMovie(name): reg_1 = r'^[\(\[\{](?P<year>\d{4})[\)\]\}]\s(?P<title>[^.]+).*(?P<extention>\..*)?$' # (2008) Iron Man.mkv reg_2 = r'^(?P<title>.*)\s[\(\[\{](?P<year>\d{4})[\)\]\}].*(?P<extentio...
en
0.298259
# (2008) Iron Man.mkv # Iron Man (2008).mkv # Iron.Man.2008.1080p.WEBRip.DDP5.1.Atmos.x264.mkv # Iron Man.mkv # (2019) The Mandalorian # The Mandalorian (2019) # The.Mandalorian.2019.1080p.WEBRip # The Mandalorian
2.92988
3
examples/example.py
salimfadhleyhtp/python-connector-api
0
6630175
<filename>examples/example.py #!/usr/bin/env python # -*- coding: utf-8 -*- # coding:=utf-8 import argparse import datetime as dt import logging import sys import meteomatics.api as api from meteomatics.logger import create_log_handler from meteomatics._constants_ import LOGGERNAME ''' For further information on...
<filename>examples/example.py #!/usr/bin/env python # -*- coding: utf-8 -*- # coding:=utf-8 import argparse import datetime as dt import logging import sys import meteomatics.api as api from meteomatics.logger import create_log_handler from meteomatics._constants_ import LOGGERNAME ''' For further information on...
en
0.79819
#!/usr/bin/env python # -*- coding: utf-8 -*- # coding:=utf-8 For further information on available parameters, models etc. please visit api.meteomatics.com In case of questions just write a mail to: <EMAIL> ###Credentials: ###Input timeseries: # e.g. 'median' # e.g. "cluster:1", see http://api.meteomatics....
2.428308
2
app.py
yoshiohasegawa/mindflex-server
0
6630176
from flask import Flask, json, jsonify, request from pymongo import MongoClient import os # Load .env variables db_name = os.environ.get('DB_NAME') db_username = os.environ.get('DB_USERNAME') db_password = os.environ.get('DB_PASSWORD') # Initialize Flask server app = Flask(__name__) # Establish MongoDB connection cl...
from flask import Flask, json, jsonify, request from pymongo import MongoClient import os # Load .env variables db_name = os.environ.get('DB_NAME') db_username = os.environ.get('DB_USERNAME') db_password = os.environ.get('DB_PASSWORD') # Initialize Flask server app = Flask(__name__) # Establish MongoDB connection cl...
en
0.456735
# Load .env variables # Initialize Flask server # Establish MongoDB connection # Connect to mindflex database # questions table # Parse _id property value of ObjectId to String # Homepage, simply return a welcome message # Questions GET route
2.973657
3
inverted_index/utils/redis_init.py
chachazhu/inverted-index.py
0
6630177
<filename>inverted_index/utils/redis_init.py import redis def con(host, port, db): """Redis connection.""" return redis.StrictRedis( host=host, port=port, db=db)
<filename>inverted_index/utils/redis_init.py import redis def con(host, port, db): """Redis connection.""" return redis.StrictRedis( host=host, port=port, db=db)
en
0.731475
Redis connection.
2.420348
2
lib/googlecloudsdk/api_lib/compute/csek_utils.py
eyalev/gcloud
0
6630178
<filename>lib/googlecloudsdk/api_lib/compute/csek_utils.py # 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/licen...
<filename>lib/googlecloudsdk/api_lib/compute/csek_utils.py # 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/licen...
en
0.775307
# 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 ag...
2.272708
2
geneticAlgorithms/sistemaEquacoesLineares.py
PauloBernardo/InteligenciaComputacional
0
6630179
import random POPULATION_SIZE = 200 GENES = '01' def func1(x, y, z, w): return pow(x, 2) + pow(y, 3) + pow(z, 4) - pow(w, 5) def func2(x, y, z, w): return pow(x, 2) + 3 * pow(z, 2) - w def func3(x, y, z, w): return pow(z, 5) - y - 10 def func4(x, y, z, w): return pow(x, 4) - z + y * w class ...
import random POPULATION_SIZE = 200 GENES = '01' def func1(x, y, z, w): return pow(x, 2) + pow(y, 3) + pow(z, 4) - pow(w, 5) def func2(x, y, z, w): return pow(x, 2) + 3 * pow(z, 2) - w def func3(x, y, z, w): return pow(z, 5) - y - 10 def func4(x, y, z, w): return pow(x, 4) - z + y * w class ...
en
0.226516
# print(population[0].chromosome)
2.96425
3
src/monitor.py
NikolayStrekalov/pymon2
1
6630180
<gh_stars>1-10 # coding: utf-8 import yaml from tasks import PeriodicTask from utils import execute_cmd from reports import CheckResult, CheckResultCode, create_reporters class ShellChecker(object): CODE_MAP = { '0': CheckResultCode.SUCCESS, '1': CheckResultCode.INFO, '2': CheckResultCode...
# coding: utf-8 import yaml from tasks import PeriodicTask from utils import execute_cmd from reports import CheckResult, CheckResultCode, create_reporters class ShellChecker(object): CODE_MAP = { '0': CheckResultCode.SUCCESS, '1': CheckResultCode.INFO, '2': CheckResultCode.FAILURE, }...
en
0.661119
# coding: utf-8 # unknown check result
2.461757
2
widgets/src/widgets/imageswitch/widget.py
builder08/enigma2-plugins_2
0
6630181
from __future__ import print_function from Plugins.Extensions.Widgets.Widget import Widget from enigma import ePicLoad, ePixmap, getDesktop, eTimer from Components.Pixmap import Pixmap from twisted.web.client import downloadPage from urllib import quote_plus from os import remove as os_remove, mkdir as os_mkdir from os...
from __future__ import print_function from Plugins.Extensions.Widgets.Widget import Widget from enigma import ePicLoad, ePixmap, getDesktop, eTimer from Components.Pixmap import Pixmap from twisted.web.client import downloadPage from urllib import quote_plus from os import remove as os_remove, mkdir as os_mkdir from os...
none
1
1.980533
2
lib/galaxy/datatypes/msa.py
lesperry/Metagenomics
0
6630182
import abc import logging import os import re from galaxy.datatypes.binary import Binary from galaxy.datatypes.data import get_file_peek, Text from galaxy.datatypes.metadata import MetadataElement from galaxy.datatypes.sniff import build_sniff_from_prefix from galaxy.datatypes.util import generic_util from galaxy.util...
import abc import logging import os import re from galaxy.datatypes.binary import Binary from galaxy.datatypes.data import get_file_peek, Text from galaxy.datatypes.metadata import MetadataElement from galaxy.datatypes.sniff import build_sniff_from_prefix from galaxy.datatypes.util import generic_util from galaxy.util...
en
0.576926
>>> from galaxy.datatypes.sniff import get_test_fname >>> fname = get_test_fname( 'infernal_model.cm' ) >>> InfernalCM().sniff( fname ) True >>> fname = get_test_fname( '2.txt' ) >>> InfernalCM().sniff( fname ) False Set the number of models and the version of CM file in ...
2.001092
2
navycut/core/app_config.py
FlaskAio/navycut
4
6630183
<gh_stars>1-10 from flask import Blueprint from flask_express import FlaskExpress from flask_bootstrap import Bootstrap from importlib import import_module from werkzeug.routing import RequestRedirect from werkzeug.exceptions import MethodNotAllowed, NotFound from ._serving import run_simple_wsgi from ..http.request ...
from flask import Blueprint from flask_express import FlaskExpress from flask_bootstrap import Bootstrap from importlib import import_module from werkzeug.routing import RequestRedirect from werkzeug.exceptions import MethodNotAllowed, NotFound from ._serving import run_simple_wsgi from ..http.request import Request ...
en
0.748096
The default index view for a navycut project. The base class of navycut project. It's basically inheritaing the services from the class Flask. We have customized some the core flask features to provide this huge and fullstack service. attach all the available and required settings features with th...
2.214588
2
python_magnetgeo/Helix.py
ValletRomain/python_magnetgeo
0
6630184
#!/usr/bin/env python3 #-*- coding:utf-8 -*- """ Provides definition for Helix: * Geom data: r, z * Model Axi: definition of helical cut (provided from MagnetTools) * Model 3D: actual 3D CAD * Shape: definition of Shape eventually added to the helical cut """ import json import yaml from . import deserialize from ....
#!/usr/bin/env python3 #-*- coding:utf-8 -*- """ Provides definition for Helix: * Geom data: r, z * Model Axi: definition of helical cut (provided from MagnetTools) * Model 3D: actual 3D CAD * Shape: definition of Shape eventually added to the helical cut """ import json import yaml from . import deserialize from ....
en
0.662393
#!/usr/bin/env python3 #-*- coding:utf-8 -*- Provides definition for Helix: * Geom data: r, z * Model Axi: definition of helical cut (provided from MagnetTools) * Model 3D: actual 3D CAD * Shape: definition of Shape eventually added to the helical cut name : r : z : cutwidth: dble : odd : axi ...
2.836571
3
gaia-sdk-python/gaia_sdk/api/SkillRef.py
leftshiftone/gaia-sdk
0
6630185
import json import rx import rx.operators as ops from rx.core.typing import Observable, Scheduler from gaia_sdk.http import GaiaStreamClient class SkillProvisionCanceledResponse: def __init__(self, reference: str): self._reference = reference @property def reference(self) -> str: return...
import json import rx import rx.operators as ops from rx.core.typing import Observable, Scheduler from gaia_sdk.http import GaiaStreamClient class SkillProvisionCanceledResponse: def __init__(self, reference: str): self._reference = reference @property def reference(self) -> str: return...
none
1
2.419362
2
regtests/go/generics_subclasses.py
gython/Gython
65
6630186
''' generics classes with common base. ''' class A: def __init__(self, x:int): int self.x = x def method1(self) -> int: return self.x class B(A): def method1(self) ->int: return self.x * 2 class C(A): def method1(self) ->int: return self.x + 200 def my_generic( g:A ) ->int: return g.method1() def m...
''' generics classes with common base. ''' class A: def __init__(self, x:int): int self.x = x def method1(self) -> int: return self.x class B(A): def method1(self) ->int: return self.x * 2 class C(A): def method1(self) ->int: return self.x + 200 def my_generic( g:A ) ->int: return g.method1() def m...
en
0.902121
generics classes with common base.
3.865931
4
Kattis/dasblinkenlights.py
ruidazeng/online-judge
0
6630187
<reponame>ruidazeng/online-judge p, q, s = map(int, input().split()) for x in range(1, s + 1): if x % p == 0 and x % q == 0: print("yes") quit() print("no")
p, q, s = map(int, input().split()) for x in range(1, s + 1): if x % p == 0 and x % q == 0: print("yes") quit() print("no")
none
1
3.349272
3
podman/domain/containers_create.py
alvistack/containers-podman-py
0
6630188
"""Mixin to provide Container create() method.""" import copy import logging import re from contextlib import suppress from typing import Any, Dict, List, MutableMapping, Union from podman import api from podman.domain.containers import Container from podman.domain.images import Image from podman.domain.pods import Po...
"""Mixin to provide Container create() method.""" import copy import logging import re from contextlib import suppress from typing import Any, Dict, List, MutableMapping, Union from podman import api from podman.domain.containers import Container from podman.domain.images import Image from podman.domain.pods import Po...
en
0.701232
Mixin to provide Container create() method. # pylint: disable=too-few-public-methods Class providing create method for ContainersManager. Create a container. Args: image: Image to run. command: Command to run in the container. Keyword Args: auto_remove (bool): Enabl...
2.315223
2
CAM.py
Harry24k/CAM
1
6630189
import numpy as np import torch import torch.nn as nn import torchvision.utils r""" Implementation of CAM Arguments: model (nn.Module): a model with one GAP(Global Average Pooling) and one FC(Fully-Connected). images (torch.tensor): input images of (batch_size, n_channel, height, width). last_conv_nam...
import numpy as np import torch import torch.nn as nn import torchvision.utils r""" Implementation of CAM Arguments: model (nn.Module): a model with one GAP(Global Average Pooling) and one FC(Fully-Connected). images (torch.tensor): input images of (batch_size, n_channel, height, width). last_conv_nam...
en
0.734249
Implementation of CAM Arguments: model (nn.Module): a model with one GAP(Global Average Pooling) and one FC(Fully-Connected). images (torch.tensor): input images of (batch_size, n_channel, height, width). last_conv_name (str) : the name of the last convolutional layer of the model. fc_name (str) : the ...
2.980266
3
poseidon/base/MQHelper.py
peterkang2001/Poseidon
2
6630190
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Author: kangliang date: 2019-05-08 """ import logging import base64 from poseidon.api.RequestsHelper import Requests class MessageQueue: request = Requests() def getRabbitMqConfig(self, configKey): if True: mqConfig = "...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Author: kangliang date: 2019-05-08 """ import logging import base64 from poseidon.api.RequestsHelper import Requests class MessageQueue: request = Requests() def getRabbitMqConfig(self, configKey): if True: mqConfig = "...
zh
0.365511
#!/usr/bin/env python # -*- coding: utf-8 -*- Author: kangliang date: 2019-05-08 删除指定消息队列中的所有数据 :param configKey: 在base.py中配置文件中关于消息队列的key :return: # resp = self.request.sendRequest(url=url, method="DELETE", headers=headers,needJson=False, httpStatusExp=204) # 由于curl暂时不支持status_code 先注释...
2.428764
2
AbhishekManjaro/weather.py
munagekar/MJRDarkConcky
3
6630191
<gh_stars>1-10 import urllib,json url = "https://query.yahooapis.com/v1/public/yql?format=json&q=select+title%2C+units.temperature%2C+item.forecast%0Afrom+weather.forecast%0Awhere+woeid+in+%28select+woeid+from+geo.places+where+text%3D%22Katraj%2C+India%22%29%0Aand+u+%3D+%27C%27%0Alimit+5%0A%7C%0Asort%28field%3D%22item....
import urllib,json url = "https://query.yahooapis.com/v1/public/yql?format=json&q=select+title%2C+units.temperature%2C+item.forecast%0Afrom+weather.forecast%0Awhere+woeid+in+%28select+woeid+from+geo.places+where+text%3D%22Katraj%2C+India%22%29%0Aand+u+%3D+%27C%27%0Alimit+5%0A%7C%0Asort%28field%3D%22item.forecast.date%2...
none
1
2.916437
3
Documentation/ManualSource/wikicmd/MoinMoin/action/twikidraw.py
sleyzerzon/soar
1
6630192
# -*- coding: iso-8859-1 -*- """ MoinMoin - twikidraw This action is used to call twikidraw @copyright: 2001 by <NAME> (<EMAIL>), 2001-2004 by <NAME> <<EMAIL>>, 2005 MoinMoin:AlexanderSchremmer, 2005 DiegoOngaro at ETSZONE (<EMAIL>), 2007-200...
# -*- coding: iso-8859-1 -*- """ MoinMoin - twikidraw This action is used to call twikidraw @copyright: 2001 by <NAME> (<EMAIL>), 2001-2004 by <NAME> <<EMAIL>>, 2005 MoinMoin:AlexanderSchremmer, 2005 DiegoOngaro at ETSZONE (<EMAIL>), 2007-200...
en
0.697322
# -*- coding: iso-8859-1 -*- MoinMoin - twikidraw This action is used to call twikidraw @copyright: 2001 by <NAME> (<EMAIL>), 2001-2004 by <NAME> <<EMAIL>>, 2005 MoinMoin:AlexanderSchremmer, 2005 DiegoOngaro at ETSZONE (<EMAIL>), 2007-2008 MoinMo...
2.429481
2
rpilcd2menu/rpilcd2menu.py
SNOC/rpilcd2
0
6630193
import time # OLED screen import Adafruit_GPIO.SPI as SPI import Adafruit_SSD1306 # offscreen from PIL import Image from PIL import ImageDraw from PIL import ImageFont # Raspberry Pi pin configuration: RST = 25 # Note the following are only used with SPI: DC = 24 SPI_PORT = 0 SPI_DEVICE = 0 # 128x...
import time # OLED screen import Adafruit_GPIO.SPI as SPI import Adafruit_SSD1306 # offscreen from PIL import Image from PIL import ImageDraw from PIL import ImageFont # Raspberry Pi pin configuration: RST = 25 # Note the following are only used with SPI: DC = 24 SPI_PORT = 0 SPI_DEVICE = 0 # 128x...
en
0.736387
# OLED screen # offscreen # Raspberry Pi pin configuration: # Note the following are only used with SPI: # 128x64 display with hardware SPI: # buttons # SW1 # SW2 # SW4 # SW3 # Initialize library. # Clear display. # Create blank image for drawing. # Make sure to create image with mode '1' for 1-bit color. # Get drawing...
2.76329
3
PathPlanning/BatchInformedRRTStar/batch_informed_rrtstar.py
tanishqjasoria/PythonRobotics
7
6630194
<filename>PathPlanning/BatchInformedRRTStar/batch_informed_rrtstar.py """ Batch Informed Trees based path planning: Uses a heuristic to efficiently search increasingly dense RGGs while reusing previous information. Provides faster convergence that RRT*, Informed RRT* and other sampling based methods. Uses lazy connect...
<filename>PathPlanning/BatchInformedRRTStar/batch_informed_rrtstar.py """ Batch Informed Trees based path planning: Uses a heuristic to efficiently search increasingly dense RGGs while reusing previous information. Provides faster convergence that RRT*, Informed RRT* and other sampling based methods. Uses lazy connect...
en
0.796656
Batch Informed Trees based path planning: Uses a heuristic to efficiently search increasingly dense RGGs while reusing previous information. Provides faster convergence that RRT*, Informed RRT* and other sampling based methods. Uses lazy connecting by combining sampling based methods and A* like incremental graph sear...
2.832183
3
bioslds/sources.py
ttesileanu/bio-time-series
0
6630195
""" Define convenient objects to use as sources for Arma processes. """ import numpy as np import copy from typing import Sequence, Union, Callable from scipy import optimize class Constant(object): """ A source that always returns the same value. Attributes ---------- value Value returned ...
""" Define convenient objects to use as sources for Arma processes. """ import numpy as np import copy from typing import Sequence, Union, Callable from scipy import optimize class Constant(object): """ A source that always returns the same value. Attributes ---------- value Value returned ...
en
0.79163
Define convenient objects to use as sources for Arma processes. A source that always returns the same value. Attributes ---------- value Value returned by the source. Generate constant values. Parameter --------- n Number of values to generate. A source that str...
3.21132
3
ejercicio_1.py
Taller-Abierto-de-Humanidades-Digitales/programacion
0
6630196
''' Ejercicio: Con este listado de Estados y capitales, crear un programa que sea capaz de separar cada entidad y entregar un mensaje para cada Estado que diga: La capital del Estado de Aguascalientes es Aguascalientes La capital del Estado de Baja California es Mexicali La capital del Estado de Baja California Sur e...
''' Ejercicio: Con este listado de Estados y capitales, crear un programa que sea capaz de separar cada entidad y entregar un mensaje para cada Estado que diga: La capital del Estado de Aguascalientes es Aguascalientes La capital del Estado de Baja California es Mexicali La capital del Estado de Baja California Sur e...
es
0.623431
Ejercicio: Con este listado de Estados y capitales, crear un programa que sea capaz de separar cada entidad y entregar un mensaje para cada Estado que diga: La capital del Estado de Aguascalientes es Aguascalientes La capital del Estado de Baja California es Mexicali La capital del Estado de Baja California Sur es La...
2.179801
2
larch/wxlib/xrfdisplay_fitpeaks.py
fmneto/xraylarch
0
6630197
#!/usr/bin/env python """ fitting GUI for XRF display """ import time import copy from functools import partial from collections import OrderedDict from threading import Thread import json import numpy as np import wx import wx.lib.agw.pycollapsiblepane as CP import wx.lib.scrolledpanel as scrolled import wx.dataview...
#!/usr/bin/env python """ fitting GUI for XRF display """ import time import copy from functools import partial from collections import OrderedDict from threading import Thread import json import numpy as np import wx import wx.lib.agw.pycollapsiblepane as CP import wx.lib.scrolledpanel as scrolled import wx.dataview...
en
0.387898
#!/usr/bin/env python fitting GUI for XRF display read filters data ## Set up XRF Model _xrfmodel = xrf_model(xray_energy={en_xray:.2f}, count_time={count_time:.5f}, energy_min={en_min:.2f}, energy_max={en_max:.2f}) _xrfmodel.set_detector(thickness={det_thk:.5f}, material='{det_mat:s}', ...
1.978641
2
pythonProject/033.py
MontanhaRio/python
0
6630198
#033 - Maior e menor valores a = int(input('primeiro valor:')) b = int(input('segundo valor:')) c = int(input('terceiro valor: ')) menor = a if b < a and b < c: menor = b if c < a and c < b: menor = c maior = a if b > a and b > c: maior = b if c > a and c > b: maior = c print(f'O menor valor digitado fo...
#033 - Maior e menor valores a = int(input('primeiro valor:')) b = int(input('segundo valor:')) c = int(input('terceiro valor: ')) menor = a if b < a and b < c: menor = b if c < a and c < b: menor = c maior = a if b > a and b > c: maior = b if c > a and c > b: maior = c print(f'O menor valor digitado fo...
pt
0.610416
#033 - Maior e menor valores
3.930107
4
akshare/pro/client.py
lisong996/akshare
4,202
6630199
<filename>akshare/pro/client.py<gh_stars>1000+ # -*- coding:utf-8 -*- #!/usr/bin/env python """ Date: 2019/11/10 22:52 Desc: 数据接口源代码 """ from functools import partial from urllib import parse import pandas as pd import requests class DataApi: __token = "" __http_url = "https://api.qhkch.com" def __init...
<filename>akshare/pro/client.py<gh_stars>1000+ # -*- coding:utf-8 -*- #!/usr/bin/env python """ Date: 2019/11/10 22:52 Desc: 数据接口源代码 """ from functools import partial from urllib import parse import pandas as pd import requests class DataApi: __token = "" __http_url = "https://api.qhkch.com" def __init...
zh
0.507774
# -*- coding:utf-8 -*- #!/usr/bin/env python Date: 2019/11/10 22:52 Desc: 数据接口源代码 初始化函数 :param token: API接口TOKEN,用于用户认证 :type token: str :param timeout: 超时设置 :type timeout: int :param api_name: 需要调取的接口 :type api_name: str :param fields: 想要获取的字段 :type fields: str ...
2.68139
3
Resource/random_resource.py
GopalNG/FlaskApiRandom
0
6630200
<reponame>GopalNG/FlaskApiRandom<filename>Resource/random_resource.py import json from flask_restful import Resource from Random.RandomObjects import RandomObjects from Models.random_models import GenerateModel from flask import send_file from io import BytesIO class CreateRandom(Resource): @classmetho...
import json from flask_restful import Resource from Random.RandomObjects import RandomObjects from Models.random_models import GenerateModel from flask import send_file from io import BytesIO class CreateRandom(Resource): @classmethod def get(cls): """ @usage : It Wil Create A Ra...
en
0.818045
@usage : It Wil Create A Random Data and Save the DB :return: A Json with Message and File Url For Download @usage: It Is used to Get the report of generated File by CreateRandom from DB :param file_id: Created By CreateRandom :return: a dict with Report of the file @usage: It Is Used For Dow...
2.995637
3
tests/test_utils.py
H4CKY54CK/hackytools
5
6630201
from hackytools.utils import * def test_combutations(): data = 'ABC' assert list(combutations(data)) == [('A',), ('B',), ('C',), ('A', 'B'), ('A', 'C'), ('B', 'C'), ('A', 'B', 'C')] assert list(combutations(data, 2)) == [('A',), ('B',), ('C',), ('A', 'B'), ('A', 'C'), ('B', 'C')] assert list(combutati...
from hackytools.utils import * def test_combutations(): data = 'ABC' assert list(combutations(data)) == [('A',), ('B',), ('C',), ('A', 'B'), ('A', 'C'), ('B', 'C'), ('A', 'B', 'C')] assert list(combutations(data, 2)) == [('A',), ('B',), ('C',), ('A', 'B'), ('A', 'C'), ('B', 'C')] assert list(combutati...
none
1
2.642274
3
tests/test_ilmat.py
zhengp0/spmat
0
6630202
<reponame>zhengp0/spmat<filename>tests/test_ilmat.py """ Test ILMat """ import pytest import numpy as np from spmat import ILMat # pylint: disable=redefined-outer-name SHAPE = (5, 3) @pytest.fixture def ilmat(): lmat = np.random.randn(*SHAPE) return ILMat(lmat) def test_ilmat(ilmat): my_result = ilm...
""" Test ILMat """ import pytest import numpy as np from spmat import ILMat # pylint: disable=redefined-outer-name SHAPE = (5, 3) @pytest.fixture def ilmat(): lmat = np.random.randn(*SHAPE) return ILMat(lmat) def test_ilmat(ilmat): my_result = ilmat.mat.dot(ilmat.invmat) tr_result = np.identity(...
en
0.402141
Test ILMat # pylint: disable=redefined-outer-name
2.257238
2
systemcheck/systems/ABAP/plugins/actions/action_abap_validate_redundant_password_hashes.py
team-fasel/SystemCheck
2
6630203
<reponame>team-fasel/SystemCheck from systemcheck.systems import ABAP import systemcheck import logging from pprint import pformat import re class ActionAbapValidateRedundantPasswordHashes(systemcheck.plugins.ActionAbapCheck): """ Validate the scheduling of batch jobs """ def __init__(self): sup...
from systemcheck.systems import ABAP import systemcheck import logging from pprint import pformat import re class ActionAbapValidateRedundantPasswordHashes(systemcheck.plugins.ActionAbapCheck): """ Validate the scheduling of batch jobs """ def __init__(self): super().__init__() self.logg...
en
0.745406
Validate the scheduling of batch jobs # Setup Job for # Get Spool #Analyze Spool # Start working the log lines for table USR02 until USH02 begins # Line starts with a digit
2.196487
2
packages/nonebot-adapter-mirai/nonebot/adapters/mirai/event/message.py
emicoto/none
1,757
6630204
from datetime import datetime from typing import Any, Optional from pydantic import BaseModel, Field from nonebot.typing import overrides from ..message import MessageChain from .base import Event, GroupChatInfo, PrivateChatInfo class MessageSource(BaseModel): id: int time: datetime class MessageEvent(Ev...
from datetime import datetime from typing import Any, Optional from pydantic import BaseModel, Field from nonebot.typing import overrides from ..message import MessageChain from .base import Event, GroupChatInfo, PrivateChatInfo class MessageSource(BaseModel): id: int time: datetime class MessageEvent(Ev...
zh
0.987352
消息事件基类 群消息事件 好友消息事件 临时会话消息事件
2.351241
2
imdb_bidirectional_lstm.py
hc-super66/Word2Vec-Learning
0
6630205
# max len = 56 from __future__ import absolute_import from __future__ import print_function import logging import os import sys import numpy as np import pandas as pd from keras import Sequential from keras.layers import Dense, Dropout, Embedding, GRU, Bidirectional from keras.models import Model from keras.preproces...
# max len = 56 from __future__ import absolute_import from __future__ import print_function import logging import os import sys import numpy as np import pandas as pd from keras import Sequential from keras.layers import Dense, Dropout, Embedding, GRU, Bidirectional from keras.models import Model from keras.preproces...
en
0.590384
# max len = 56 # maxlen = 56 Transforms sentence into a list of indices. Pad with zeroes. Transforms sentences into a 2-d matrix. # X_valid = sequence.pad_sequences(np.array(X_valid), maxlen=maxlen) # y_valid = np.array(y_valid) # pickle_file = os.path.join('pickle', 'vader_movie_reviews_glove.pickle3') # pickle_file =...
2.689999
3
tests.py
Mahalinoro/game-of-life
3
6630206
import unittest from Anime import Anime from AnimeScraper import AnimeScraper from Storage import Storage from User import User, UserStorage from password_hash import verify_password from Recommender import Recommender class TestUnitCase(unittest.TestCase): def test_anime_object(self): """Anime Class Test...
import unittest from Anime import Anime from AnimeScraper import AnimeScraper from Storage import Storage from User import User, UserStorage from password_hash import verify_password from Recommender import Recommender class TestUnitCase(unittest.TestCase): def test_anime_object(self): """Anime Class Test...
en
0.752156
Anime Class Testing Anime Scraper Class Testing Storage Class Testing User Class Testing User Storage Class Testing Recommender Class Testing
2.898906
3
generated_input.py
MaxLing/food-101-resnet
3
6630207
<reponame>MaxLing/food-101-resnet<gh_stars>1-10 '''Visualization of the filters of resnet50, via gradient ascent in input space. This script can run on CPU in a few minutes. ''' from __future__ import print_function from scipy.misc import imsave import numpy as np import time from keras import models from keras import...
'''Visualization of the filters of resnet50, via gradient ascent in input space. This script can run on CPU in a few minutes. ''' from __future__ import print_function from scipy.misc import imsave import numpy as np import time from keras import models from keras import backend as K from keras.applications import res...
en
0.722913
Visualization of the filters of resnet50, via gradient ascent in input space. This script can run on CPU in a few minutes. # dimensions of the generated pictures for each filter/class # the name of the layer we want to visualize - last layer # util function to convert a tensor into a valid image # normalize tensor: cen...
3.212098
3
09_Implementing_Collections/test/test_sorted_set.py
MANOJPATRA1991/Python-Beyond-the-Basics
0
6630208
import unittest from collections.abc import (Container, Sized, Iterable, Sequence, Set) from .src.sorted_set import SortedSet class TestConstruction(unittest.TestCase): def test_empty(self): s = SortedSet([]) def test_from_sequence(self): s = SortedSet([7, 8, 3, 1]) def test_with_duplica...
import unittest from collections.abc import (Container, Sized, Iterable, Sequence, Set) from .src.sorted_set import SortedSet class TestConstruction(unittest.TestCase): def test_empty(self): s = SortedSet([]) def test_from_sequence(self): s = SortedSet([7, 8, 3, 1]) def test_with_duplica...
en
0.903311
# Python equality comparisons which are inherited from the ultimate base class object # are for reference equality rather than value equality or equivalence
3.16195
3
exer33.py
marvely/learn_python_the_hard_way
0
6630209
# ++++++++++++++ while loop +++++++++++++++++++++ # i = 0 numbers = [] while i < 6: print "At the top i is %d." % i numbers.append(i) i += 1 print "Number's now:", numbers print "At the bottom i is %d." % i print "The numbers: " for num in numbers: print num
# ++++++++++++++ while loop +++++++++++++++++++++ # i = 0 numbers = [] while i < 6: print "At the top i is %d." % i numbers.append(i) i += 1 print "Number's now:", numbers print "At the bottom i is %d." % i print "The numbers: " for num in numbers: print num
en
0.566343
# ++++++++++++++ while loop +++++++++++++++++++++ #
4.118906
4
Practice/AllDomains/Languages/Python/Strings/Mutations.py
DHS009/HackerRankSolutions
15
6630210
<reponame>DHS009/HackerRankSolutions #/* author:@shivkrthakur */ # Enter your code here. Read input from STDIN. Print output to STDOUT inputstr1 = raw_input().strip(); inputstr2 = raw_input().strip().split(); index = int(inputstr2[0]) outputstr = inputstr1[0:index] + inputstr2[1] + inputstr1[index+1:len(inputstr1)] pr...
#/* author:@shivkrthakur */ # Enter your code here. Read input from STDIN. Print output to STDOUT inputstr1 = raw_input().strip(); inputstr2 = raw_input().strip().split(); index = int(inputstr2[0]) outputstr = inputstr1[0:index] + inputstr2[1] + inputstr1[index+1:len(inputstr1)] print outputstr #print inputstr1[index+...
en
0.37396
#/* author:@shivkrthakur */ # Enter your code here. Read input from STDIN. Print output to STDOUT #print inputstr1[index+1:len(inputstr1)] #print("".join(strlist))
3.626806
4
src/snowflake/connector/test_util.py
666Chao666/snowflake-connector-python
0
6630211
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2012-2021 Snowflake Computing Inc. All right reserved. # import logging import os from .compat import IS_LINUX RUNNING_ON_JENKINS = os.getenv('JENKINS_HOME') is not None REGRESSION_TEST_LOG_DIR = os.getenv('CLIENT_LOG_DIR_PATH_DOCKER', '/tmp') ENABLE_TE...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2012-2021 Snowflake Computing Inc. All right reserved. # import logging import os from .compat import IS_LINUX RUNNING_ON_JENKINS = os.getenv('JENKINS_HOME') is not None REGRESSION_TEST_LOG_DIR = os.getenv('CLIENT_LOG_DIR_PATH_DOCKER', '/tmp') ENABLE_TE...
en
0.585445
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2012-2021 Snowflake Computing Inc. All right reserved. #
1.784744
2
HPOBenchExperimentUtils/utils/dragonfly_utils.py
PhMueller/TrajectoryParser
0
6630212
from math import exp, log, floor from typing import List, Dict, Tuple, Union, Callable from pathlib import Path from argparse import Namespace import logging import os, uuid, sys import json _log = logging.getLogger(__name__) # -------------------------------Begin code adapted directly from the dragonfly repo--------...
from math import exp, log, floor from typing import List, Dict, Tuple, Union, Callable from pathlib import Path from argparse import Namespace import logging import os, uuid, sys import json _log = logging.getLogger(__name__) # -------------------------------Begin code adapted directly from the dragonfly repo--------...
en
0.779923
# -------------------------------Begin code adapted directly from the dragonfly repo------------------------------------ # Get options # get_option_specs('config', False, None, 'Path to the json or pb config file. '), # get_option_specs('options', False, None, 'Path to the options file. '), Returns all arguments for th...
2.153702
2
tests/multivariate/secret_key_agreement/test_two_part_intrinsic_mutual_information.py
Ejjaffe/dit
1
6630213
""" Tests for dit.multivariate.secret_key_agreement.two_part_intrinsic_mutual_information """ import pytest from dit.example_dists import giant_bit, n_mod_m from dit.exceptions import ditException from dit.multivariate.secret_key_agreement import ( two_part_intrinsic_total_correlation, two_part_intrinsic_dual...
""" Tests for dit.multivariate.secret_key_agreement.two_part_intrinsic_mutual_information """ import pytest from dit.example_dists import giant_bit, n_mod_m from dit.exceptions import ditException from dit.multivariate.secret_key_agreement import ( two_part_intrinsic_total_correlation, two_part_intrinsic_dual...
en
0.654337
Tests for dit.multivariate.secret_key_agreement.two_part_intrinsic_mutual_information # (n_mod_m(3, 2), 0.0), # (n_mod_m(3, 2), 0.0), # (n_mod_m(3, 2), 0.0), Ensure an exception is raised if no conditional variable is supplied. Ensure an exception is raised if no conditional variable is supplied.
2.153329
2
core/src/zeit/content/link/link.py
rickdg/vivi
5
6630214
from zeit.cms.i18n import MessageFactory as _ import grokcore.component as grok import zeit.cms.content.metadata import zeit.cms.content.property import zeit.cms.content.xmlsupport import zeit.cms.interfaces import zeit.cms.type import zeit.content.link.interfaces import zeit.push.interfaces import zope.component impor...
from zeit.cms.i18n import MessageFactory as _ import grokcore.component as grok import zeit.cms.content.metadata import zeit.cms.content.property import zeit.cms.content.xmlsupport import zeit.cms.interfaces import zeit.cms.type import zeit.content.link.interfaces import zeit.push.interfaces import zope.component impor...
en
0.919901
A type for managing links to non-local content.
1.57147
2
computer_guess_number.py
AWells595/computer-guess-number
0
6630215
# this script will seek to have the computer guess a number selected by the user between 1 - 100 # the user will be prompted to anwser 'too high' or 'too low' when the computer guesses wrong # or 'correct' when the computer guesses correctly # it will then count how many guesses it took to get the correct number im...
# this script will seek to have the computer guess a number selected by the user between 1 - 100 # the user will be prompted to anwser 'too high' or 'too low' when the computer guesses wrong # or 'correct' when the computer guesses correctly # it will then count how many guesses it took to get the correct number im...
en
0.89502
# this script will seek to have the computer guess a number selected by the user between 1 - 100 # the user will be prompted to anwser 'too high' or 'too low' when the computer guesses wrong # or 'correct' when the computer guesses correctly # it will then count how many guesses it took to get the correct number This f...
4.559936
5
MyBinarizer.py
CMU-IDS-2022/final-project-zebra
0
6630216
from sklearn.preprocessing import MultiLabelBinarizer from sklearn.base import BaseEstimator, TransformerMixin import pandas as pd # This class is used to binarize a multi-label column # It can be understood as a multi-label one-hot encoder class MyBinarizer(BaseEstimator, TransformerMixin): def __init__(self): ...
from sklearn.preprocessing import MultiLabelBinarizer from sklearn.base import BaseEstimator, TransformerMixin import pandas as pd # This class is used to binarize a multi-label column # It can be understood as a multi-label one-hot encoder class MyBinarizer(BaseEstimator, TransformerMixin): def __init__(self): ...
en
0.736725
# This class is used to binarize a multi-label column # It can be understood as a multi-label one-hot encoder Set up the class Fit the binarizer on all the features in the dataframe # print(self.mlb_list) Return the transformed dataframe
3.536633
4
niapy/tests/test_utility.py
hrnciar/NiaPy
0
6630217
<gh_stars>0 # encoding=utf8 from unittest import TestCase import numpy as np from numpy.random import default_rng from niapy.algorithms import Algorithm from niapy.benchmarks import Benchmark from niapy.util import full_array, repair class FullArrayTestCase(TestCase): def test_a_float(self): A = full_ar...
# encoding=utf8 from unittest import TestCase import numpy as np from numpy.random import default_rng from niapy.algorithms import Algorithm from niapy.benchmarks import Benchmark from niapy.util import full_array, repair class FullArrayTestCase(TestCase): def test_a_float(self): A = full_array(25.25, 1...
de
0.140563
# encoding=utf8 # vim: tabstop=3 noexpandtab shiftwidth=3 softtabstop=3
2.483227
2
CA/Assets/FbxExporters/Integrations/Autodesk/maya/plug-ins/UnityFbxForMayaPlugin.py
Bartlett-RC3/skilling-module-1-peljevic
0
6630218
#- ######################################################################## # Copyright (c) 2017 Unity Technologies. All rights reserved. # NOTICE: All information contained herein is, and remains # the property of Unity Technology Aps. and its suppliers, # if any. The intellectual and technical c...
#- ######################################################################## # Copyright (c) 2017 Unity Technologies. All rights reserved. # NOTICE: All information contained herein is, and remains # the property of Unity Technology Aps. and its suppliers, # if any. The intellectual and technical c...
en
0.707196
#- ######################################################################## # Copyright (c) 2017 Unity Technologies. All rights reserved. # NOTICE: All information contained herein is, and remains # the property of Unity Technology Aps. and its suppliers, # if any. The intellectual and technical concep...
1.799209
2
polls/migrations/0003_search.py
simranlotey/Blood-Bank-Management-System
9
6630219
<reponame>simranlotey/Blood-Bank-Management-System # Generated by Django 3.2 on 2021-05-08 22:35 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('polls', '0002_contact'), ] operations = [ migrations.CreateModel( name='search'...
# Generated by Django 3.2 on 2021-05-08 22:35 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('polls', '0002_contact'), ] operations = [ migrations.CreateModel( name='search', fields=[ ('id', model...
en
0.856412
# Generated by Django 3.2 on 2021-05-08 22:35
1.913833
2
Regression_Modeling.py
kevinidea/Predict_Lap_Times
0
6630220
<reponame>kevinidea/Predict_Lap_Times import pandas as pd from sklearn.cross_validation import train_test_split, ShuffleSplit from sklearn.preprocessing import StandardScaler, MinMaxScaler from sklearn.linear_model import LinearRegression, Ridge, Lasso, BayesianRidge, SGDRegressor from sklearn.metrics import mean_absol...
import pandas as pd from sklearn.cross_validation import train_test_split, ShuffleSplit from sklearn.preprocessing import StandardScaler, MinMaxScaler from sklearn.linear_model import LinearRegression, Ridge, Lasso, BayesianRidge, SGDRegressor from sklearn.metrics import mean_absolute_error, mean_squared_error, r2_scor...
en
0.520623
#convert all lap times into seconds #Copy Lap Time column to Lap_Time #Override the lap_time that match the pattern with transformed lap time #Delete the Original lap time column #Encode categorical variable(s) into boolean dummy variable(s) #Dummy code categorical variable(s) #All categorical variable(s): 'Condition',...
2.735115
3
gevent/echo2.py
irr/python-labs
4
6630221
from gevent.server import StreamServer def connection_handler(socket, address): for l in socket.makefile('r'): socket.sendall(l.encode('ascii')) if __name__ == '__main__': server = StreamServer(('0.0.0.0', 8000), connection_handler) server.serve_forever()
from gevent.server import StreamServer def connection_handler(socket, address): for l in socket.makefile('r'): socket.sendall(l.encode('ascii')) if __name__ == '__main__': server = StreamServer(('0.0.0.0', 8000), connection_handler) server.serve_forever()
none
1
2.537946
3
model_revision/apps.py
Proper-Job/django-model-revision
0
6630222
<gh_stars>0 from django.apps import AppConfig class ModelRevisionConfig(AppConfig): name = 'model_revision'
from django.apps import AppConfig class ModelRevisionConfig(AppConfig): name = 'model_revision'
none
1
1.119261
1
minghu6/tools/send_email.py
minghu6/py-minghu6
2
6630223
<filename>minghu6/tools/send_email.py # -*- coding:utf-8 -*- """SEND_EMAIL Usage: send_email <from> <to> <subj> <body> [--attachments=<attachments>] [--password=<password>] [--cc=<cc>] [--bcc=<bcc>] [--debug] Options: <from> from email address <to> to email address <subj> subject of the emai...
<filename>minghu6/tools/send_email.py # -*- coding:utf-8 -*- """SEND_EMAIL Usage: send_email <from> <to> <subj> <body> [--attachments=<attachments>] [--password=<password>] [--cc=<cc>] [--bcc=<bcc>] [--debug] Options: <from> from email address <to> to email address <subj> subject of the emai...
en
0.716923
# -*- coding:utf-8 -*- SEND_EMAIL Usage: send_email <from> <to> <subj> <body> [--attachments=<attachments>] [--password=<password>] [--cc=<cc>] [--bcc=<bcc>] [--debug] Options: <from> from email address <to> to email address <subj> subject of the email <body> body of the email -a --attac...
2.49574
2
tests/test_wf_status_update.py
ankur6ue/bff-ocr
0
6630224
import pytest import requests import time import uuid import time import json import redis import threading import datetime as dt from prettytable import PrettyTable # This is the URL for the kubernetes ingress + prefix path for the ocr-bff service url = 'http://127.0.0.1:30559/ocr-bff' # url = 'http://127.0.0.1:5001' ...
import pytest import requests import time import uuid import time import json import redis import threading import datetime as dt from prettytable import PrettyTable # This is the URL for the kubernetes ingress + prefix path for the ocr-bff service url = 'http://127.0.0.1:30559/ocr-bff' # url = 'http://127.0.0.1:5001' ...
en
0.650108
# This is the URL for the kubernetes ingress + prefix path for the ocr-bff service # url = 'http://127.0.0.1:5001' # Trigger a job and check the status updates in redis directly # Send a start_workflow status update message # add another 6 characters for the pod_name. Remember, status updates are sent by a pod # get st...
2.13147
2
portscan.py
M4chin3M4N/pyscan
0
6630225
<gh_stars>0 import socket from colorama import Fore as fore from threading import Thread, Lock from queue import Queue import os def init(): print("portscanner_module [OK]") def execute(host): N_THREADS = 400 global q q = Queue() print_lock = Lock() global open_ports open...
import socket from colorama import Fore as fore from threading import Thread, Lock from queue import Queue import os def init(): print("portscanner_module [OK]") def execute(host): N_THREADS = 400 global q q = Queue() print_lock = Lock() global open_ports open_ports = [] ...
en
0.311778
#print("Enter the range for scan Default: 1-1024") #port_range = 1-65535 #try: # start,end = port_range.split("-") # start,end = int(start),int(end) # global ports # ports = [p for p in range(start,end)] #except: #os.system("clear")
2.933126
3
models/5-Deepflash2/input/deepflash2-lfs/deepflash2/_nbdev.py
cns-iu/HuBMAP---Hacking-the-Kidney
0
6630226
# AUTOGENERATED BY NBDEV! DO NOT EDIT! __all__ = ["index", "modules", "custom_doc_links", "git_url"] index = {"Config": "00_learner.ipynb", "Learner.apply_dropout": "00_learner.ipynb", "energy_max": "00_learner.ipynb", "Learner.predict_tiles": "00_learner.ipynb", "EnsembleLearner":...
# AUTOGENERATED BY NBDEV! DO NOT EDIT! __all__ = ["index", "modules", "custom_doc_links", "git_url"] index = {"Config": "00_learner.ipynb", "Learner.apply_dropout": "00_learner.ipynb", "energy_max": "00_learner.ipynb", "Learner.predict_tiles": "00_learner.ipynb", "EnsembleLearner":...
en
0.183601
# AUTOGENERATED BY NBDEV! DO NOT EDIT!
1.12593
1
Logic/Classes/LogicConfData.py
terexdev/BSDS-V39
11
6630227
<filename>Logic/Classes/LogicConfData.py from Logic.Data.DataManager import Reader from Logic.Data.DataManager import Writer class LogicConfData: def decode(self: Reader): pass def encode(self: Writer): self.writeVint(0) # Event Slots IDs Array self.writeVint(22) # Count ...
<filename>Logic/Classes/LogicConfData.py from Logic.Data.DataManager import Reader from Logic.Data.DataManager import Writer class LogicConfData: def decode(self: Reader): pass def encode(self: Writer): self.writeVint(0) # Event Slots IDs Array self.writeVint(22) # Count ...
en
0.699249
# Event Slots IDs Array # Count # Gem Grab # Showdown # Daily Events # Team Events # Duo Showdown # Team Events 2 # Special Events # Solo Events # Power Play # Seasonal Events # Seasonal Events 2 # Candidates of The Day # Winner of The Day # Solo Mode Power League # Team Mode Power League # Club league # Club league # ...
2.551912
3
Python/Product/PythonTools/ptvsd/repl/ipython.py
techkey/PTVS
404
6630228
# Python Tools for Visual Studio # Copyright(c) Microsoft Corporation # 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 # # THI...
# Python Tools for Visual Studio # Copyright(c) Microsoft Corporation # 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 # # THI...
en
0.775019
# Python Tools for Visual Studio # Copyright(c) Microsoft Corporation # 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 # # THIS ...
2.293838
2
virtool/uploads/utils.py
ReeceHoffmann/virtool
0
6630229
import os import pathlib from logging import getLogger from typing import Any, Callable, Optional import aiofiles from aiohttp.web_request import Request from cerberus import Validator logger = getLogger(__name__) CHUNK_SIZE = 1024 * 1000 * 50 def is_gzip_compressed(chunk: bytes): """ Check if a file is gz...
import os import pathlib from logging import getLogger from typing import Any, Callable, Optional import aiofiles from aiohttp.web_request import Request from cerberus import Validator logger = getLogger(__name__) CHUNK_SIZE = 1024 * 1000 * 50 def is_gzip_compressed(chunk: bytes): """ Check if a file is gz...
en
0.85831
Check if a file is gzip compressed. Peek at the first two bytes for the gzip magic number and raise and exception if it is not present. :param chunk: First byte chunk from a file being uploaded :raises OSError: An OSError is raised when the file is not gzip-compressed Validate `name` given in an HTTP ...
2.76486
3
game/Skeleton.py
anjali1729/FuzzyGame-GOT
0
6630230
<filename>game/Skeleton.py from random import randrange import pygame class Skeleton: x = 0 y = 0 direction = -1 step = 1 image = None up_image = down_image = left_image = right_image = None attack_image = None health = 0 attack = None attack_rate = 0 attack_charge_full = 0 ...
<filename>game/Skeleton.py from random import randrange import pygame class Skeleton: x = 0 y = 0 direction = -1 step = 1 image = None up_image = down_image = left_image = right_image = None attack_image = None health = 0 attack = None attack_rate = 0 attack_charge_full = 0 ...
en
0.222379
# formation based on army coordinates # sprite # sprite # sprite # sprite #temp_bot_coord_dict.pop(str(enemy_bot.gridx) + ":" + str(enemy_bot.gridy), None) # update position #self.draw(display_surf) #alpha = 128 #attack_image.fill((255, 255, 255, alpha), None, pygame.BLEND_RGBA_MULT)
3.184461
3
spiketools/tests/utils/test_trials.py
claire98han/SpikeTools
1
6630231
<gh_stars>1-10 """Tests for spiketools.utils.trials""" import numpy as np from spiketools.utils.trials import * ################################################################################################### ################################################################################################### def ...
"""Tests for spiketools.utils.trials""" import numpy as np from spiketools.utils.trials import * ################################################################################################### ################################################################################################### def test_epoch_spik...
de
0.722249
Tests for spiketools.utils.trials ################################################################################################### ################################################################################################### # Check with time reseting # Check with time reseting
2.368327
2
api/v1/recipe_groups/serializers.py
RyanNoelk/OpenEats
113
6630232
#!/usr/bin/env python # encoding: utf-8 from __future__ import unicode_literals from rest_framework import serializers from .models import Cuisine, Course, Tag class CuisineSerializer(serializers.ModelSerializer): """ Standard `rest_framework` ModelSerializer """ total = serializers.IntegerField(read_only=Tr...
#!/usr/bin/env python # encoding: utf-8 from __future__ import unicode_literals from rest_framework import serializers from .models import Cuisine, Course, Tag class CuisineSerializer(serializers.ModelSerializer): """ Standard `rest_framework` ModelSerializer """ total = serializers.IntegerField(read_only=Tr...
en
0.825695
#!/usr/bin/env python # encoding: utf-8 Standard `rest_framework` ModelSerializer Standard `rest_framework` ModelSerializer Standard `rest_framework` ModelSerializer # TODO: I really don't get how to process many to many db fields with django rest, # So, I'll just remove the validation on the title so that it will pass...
2.288697
2
trustscore.py
google/TrustScore
145
6630233
<filename>trustscore.py # Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
<filename>trustscore.py # Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
en
0.884246
# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
2.820567
3
apps/authapp.py
sparsh-ai/reco-front
0
6630234
import dash import dash_auth import dash_core_components as dcc import dash_html_components as html import plotly # Keep this out of source code repository - save in a file or a database VALID_USERNAME_PASSWORD_PAIRS = { 'hello': '<PASSWORD>' } external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']...
import dash import dash_auth import dash_core_components as dcc import dash_html_components as html import plotly # Keep this out of source code repository - save in a file or a database VALID_USERNAME_PASSWORD_PAIRS = { 'hello': '<PASSWORD>' } external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']...
en
0.723296
# Keep this out of source code repository - save in a file or a database
2.603049
3
setup.py
prosehair/django-fsm-admin
161
6630235
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys from setuptools import setup, find_packages import fsm_admin readme = open("README.rst").read() setup( name="django-fsm-admin", version=fsm_admin.__version__, author=fsm_admin.__author__, description="Integrate django-fsm state transi...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys from setuptools import setup, find_packages import fsm_admin readme = open("README.rst").read() setup( name="django-fsm-admin", version=fsm_admin.__version__, author=fsm_admin.__author__, description="Integrate django-fsm state transi...
en
0.352855
#!/usr/bin/env python # -*- coding: utf-8 -*-
1.123838
1
LC/26.py
szhu3210/LeetCode_Solutions
2
6630236
class Solution(object): def removeDuplicates(self, nums): """ :type nums: List[int] :rtype: int """ nums[:] = sorted(list(set(nums))) return len(set(nums))
class Solution(object): def removeDuplicates(self, nums): """ :type nums: List[int] :rtype: int """ nums[:] = sorted(list(set(nums))) return len(set(nums))
en
0.231312
:type nums: List[int] :rtype: int
3.169306
3
nginx/Controller/State.py
NTGDeveloper/kasa-camera
13
6630237
from collections import namedtuple class State: def bind_to(self, callback): self._observers.append(callback) def notifyObservers(self, propertyName): for callback in self._observers: callback(Event(changedProperty=propertyName, state=self)) @property def isCameraEnabled(se...
from collections import namedtuple class State: def bind_to(self, callback): self._observers.append(callback) def notifyObservers(self, propertyName): for callback in self._observers: callback(Event(changedProperty=propertyName, state=self)) @property def isCameraEnabled(se...
none
1
2.856378
3
utils/cli_utils.py
yangdangfu/predictor_selection
0
6630238
<reponame>yangdangfu/predictor_selection # -*- coding: utf-8 -*- """ Some utility functions about the CLI (Command Line Interface) usages """ def arguments_check(keys: list, required_keys: list): for k in keys: if k not in required_keys: raise KeyError(f"Unsupported argument {k}") for sk...
# -*- coding: utf-8 -*- """ Some utility functions about the CLI (Command Line Interface) usages """ def arguments_check(keys: list, required_keys: list): for k in keys: if k not in required_keys: raise KeyError(f"Unsupported argument {k}") for sk in required_keys: if sk not in k...
en
0.851395
# -*- coding: utf-8 -*- Some utility functions about the CLI (Command Line Interface) usages
3.054194
3
bigquery/google/cloud/bigquery/dbapi/cursor.py
javisantana/google-cloud-python
0
6630239
<gh_stars>0 # Copyright 2017 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 ...
# Copyright 2017 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, ...
en
0.65423
# Copyright 2017 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.301853
2
src/controller/game_controller.py
frostygum/TicTacToe
0
6630240
<gh_stars>0 #! Import required python built-in modules from functools import partial #! Import required self-made modules from src.model.board import Board class GameController(): """ This class is used as StartView Controller """ def __init__(self, app): """Function to initiate game ...
#! Import required python built-in modules from functools import partial #! Import required self-made modules from src.model.board import Board class GameController(): """ This class is used as StartView Controller """ def __init__(self, app): """Function to initiate game window settin...
en
0.866777
#! Import required python built-in modules #! Import required self-made modules This class is used as StartView Controller Function to initiate game window settings Function to give the button ability Button Ability when clicked Function to handle when received update from opponent Function to disable all button if cur...
2.968238
3
dataframe_generator/data_type.py
szvasas/dataframe-generator
2
6630241
import re import string from datetime import date, timedelta, datetime from math import copysign from random import randint, choice class DataType: @staticmethod def create_from_string(data_type, raw_string: str): if re.match(data_type.type_descriptor, raw_string): return data_type() ...
import re import string from datetime import date, timedelta, datetime from math import copysign from random import randint, choice class DataType: @staticmethod def create_from_string(data_type, raw_string: str): if re.match(data_type.type_descriptor, raw_string): return data_type() ...
none
1
2.993459
3
Resources/DesktopBasic/ComponentsExerciseScript.py
FMEEvangelist/FMEData
0
6630242
import shutil import os if not os.path.exists('C:/FundraisingWalk'): os.makedirs('C:/FundraisingWalk') shutil.copy2('c:/FMEData2017/Output/Training/FundraisingWalk.kml', 'C:/FundraisingWalk/FundraisingWalk.kml')
import shutil import os if not os.path.exists('C:/FundraisingWalk'): os.makedirs('C:/FundraisingWalk') shutil.copy2('c:/FMEData2017/Output/Training/FundraisingWalk.kml', 'C:/FundraisingWalk/FundraisingWalk.kml')
none
1
2.149858
2
fx_findings/base/plotting.py
maxoja/betting-simulator
0
6630243
import matplotlib.pyplot as plt from matplotlib.ticker import (AutoMinorLocator, MultipleLocator) import numpy as np from ..base.enums import Direction, Clr def plot_boxes(samples, labels, block=False): plt.figure() plt.boxplot(samples, labels=labels) plt.show(block=block) def plot_lines(lines, title="", ...
import matplotlib.pyplot as plt from matplotlib.ticker import (AutoMinorLocator, MultipleLocator) import numpy as np from ..base.enums import Direction, Clr def plot_boxes(samples, labels, block=False): plt.figure() plt.boxplot(samples, labels=labels) plt.show(block=block) def plot_lines(lines, title="", ...
en
0.880389
# use case 1: You know the RSI value at each trade and also the trade results. # The trades are categorised into 2 groups, gain and loss groups. # This plot visualises and help choosing which RSI thresholdis best # to exclude as many loss trades and remain as many gain trades...
2.841706
3
commons/fl_init.py
gumazon/gumazonopensource
0
6630244
__version__ = '0.1.0' # general: __title__ = __file__ __author__ = 'Gumshoe Media Inc.' __email__ = '<EMAIL>' # license: __license_setup_title__ = 'GNU General Public License v3' __license_setup_classifier__ = 'GNU General Public License v3 (GPLv3)'
__version__ = '0.1.0' # general: __title__ = __file__ __author__ = 'Gumshoe Media Inc.' __email__ = '<EMAIL>' # license: __license_setup_title__ = 'GNU General Public License v3' __license_setup_classifier__ = 'GNU General Public License v3 (GPLv3)'
en
0.267519
# general: # license:
0.941361
1
examples/chemu-gui/emulator.py
brenstar/chemu
0
6630245
from PyQt4 import QtCore, QtGui import PyChemu from display import ChipDisplay, ChipDisplayWidget from worker import EmulatorWorker from ctypes import pointer, c_char_p from enum import Enum # displays the state of the chip keyboard class ChipInputWidget(QtGui.QWidget): class InputButton(QtGui.QFrame): ...
from PyQt4 import QtCore, QtGui import PyChemu from display import ChipDisplay, ChipDisplayWidget from worker import EmulatorWorker from ctypes import pointer, c_char_p from enum import Enum # displays the state of the chip keyboard class ChipInputWidget(QtGui.QWidget): class InputButton(QtGui.QFrame): ...
en
0.279082
# displays the state of the chip keyboard # map of Qt keycodes to chip keycodes # sets the given key to be stuck, stuck keys will always have a keystate # of pressed # pass keyboard events to this widget's handlers #return True #return True #self.__worker = EmulatorWorker(self) #self.__worker.updateDisplay.connect(self...
2.751436
3
project_balls/main/migrations/0003_boardmodel_uploaddate.py
algebananazzzzz/ProjectBallsWeb
0
6630246
<reponame>algebananazzzzz/ProjectBallsWeb # Generated by Django 3.1.4 on 2021-04-29 11:37 import datetime from django.db import migrations, models from django.utils.timezone import utc class Migration(migrations.Migration): dependencies = [ ('main', '0002_auto_20210214_0306'), ] operations = [ ...
# Generated by Django 3.1.4 on 2021-04-29 11:37 import datetime from django.db import migrations, models from django.utils.timezone import utc class Migration(migrations.Migration): dependencies = [ ('main', '0002_auto_20210214_0306'), ] operations = [ migrations.AddField( m...
en
0.820414
# Generated by Django 3.1.4 on 2021-04-29 11:37
1.920326
2
python__advanced/04.tuples_and_sets_exercise/03.periodic_table.py
EmilianStoyanov/Projects-in-SoftUni
1
6630247
num = int(input()) save = set() for i in range(num): chemical = input().split() for element in chemical: save.add(element) for j in save: print(j)
num = int(input()) save = set() for i in range(num): chemical = input().split() for element in chemical: save.add(element) for j in save: print(j)
none
1
3.643891
4
sympy/physics/mechanics/body.py
msgoff/sympy
0
6630248
<gh_stars>0 from sympy.core.backend import Symbol from sympy.physics.vector import Point, Vector, ReferenceFrame from sympy.physics.mechanics import RigidBody, Particle, inertia __all__ = ["Body"] # XXX: We use type:ignore because the classes RigidBody and Particle have # inconsistent parallel axis methods that take...
from sympy.core.backend import Symbol from sympy.physics.vector import Point, Vector, ReferenceFrame from sympy.physics.mechanics import RigidBody, Particle, inertia __all__ = ["Body"] # XXX: We use type:ignore because the classes RigidBody and Particle have # inconsistent parallel axis methods that take different n...
en
0.743606
# XXX: We use type:ignore because the classes RigidBody and Particle have # inconsistent parallel axis methods that take different numbers of arguments. # type: ignore Body is a common representation of either a RigidBody or a Particle SymPy object depending on what is passed in during initialization. If a mass is ...
3.185813
3
nmrglue/analysis/segmentation.py
genematx/nmrglue
150
6630249
<gh_stars>100-1000 """ Functions to perform segmentation of NMR spectrum. """ import numpy as np import numpy.ma as ma import scipy.ndimage as ndimage from .analysisbase import neighbors # Connected segmenting method: # The connected segmentation method finds all nodes which are above a given # threshold and connect...
""" Functions to perform segmentation of NMR spectrum. """ import numpy as np import numpy.ma as ma import scipy.ndimage as ndimage from .analysisbase import neighbors # Connected segmenting method: # The connected segmentation method finds all nodes which are above a given # threshold and connected to the initial p...
en
0.77954
Functions to perform segmentation of NMR spectrum. # Connected segmenting method: # The connected segmentation method finds all nodes which are above a given # threshold and connected to the initial point. For finding all segments # the scipy.ndimage.label function is used for speed. Label connected features in data. ...
3.467483
3
scratch.py
thomasgnuttall/cae-invar-mod
0
6630250
%load_ext autoreload %autoreload 2 import datetime import os import pickle import skimage.io from complex_auto.motives_extractor import * from complex_auto.motives_extractor.extractor import * from exploration.pitch import extract_pitch_track from exploration.img import ( remove_diagonal, convolve_array_tile, b...
%load_ext autoreload %autoreload 2 import datetime import os import pickle import skimage.io from complex_auto.motives_extractor import * from complex_auto.motives_extractor.extractor import * from exploration.pitch import extract_pitch_track from exploration.img import ( remove_diagonal, convolve_array_tile, b...
en
0.718829
################ ## Parameters ## ################ # Output paths of each step in pipeline ### Pitch Extraction # Sample rate of audio # size in frames of cqt window from convolution model # was previously set to 1988 # Take sample of data, set to None to use all data # lower bound index (5000 has been used for testing...
1.880508
2