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
bin/asngen.py
kurtkeller/TA-asngen
0
6622551
#!/usr/bin/env python from splunklib.searchcommands import dispatch, GeneratingCommand, Configuration, Option, validators import sys import os import ConfigParser from StringIO import StringIO from zipfile import ZipFile import urllib2 import re import socket import struct @Configuration(type='reporting') class ASNGe...
#!/usr/bin/env python from splunklib.searchcommands import dispatch, GeneratingCommand, Configuration, Option, validators import sys import os import ConfigParser from StringIO import StringIO from zipfile import ZipFile import urllib2 import re import socket import struct @Configuration(type='reporting') class ASNGe...
en
0.887568
#!/usr/bin/env python # first try to read the defaults (in case we are in a cluster with deployed config) # then try to read the overrides
2.415957
2
src/google_foobar/P007_binary_bunnies/solution_01_tests.py
lakshmikanth-tesla/ProgrammingProblems
1
6622552
import unittest from src.google_foobar.P007_binary_bunnies.solution_01 import answer class TestSolution(unittest.TestCase): def testcase_001(self): seq = [5, 9, 8, 2, 1] expected = '6' self.assertEqual(answer(seq), expected) def testcase_002(self): seq = [1, 2, 3, 4, 5, 6, 7,...
import unittest from src.google_foobar.P007_binary_bunnies.solution_01 import answer class TestSolution(unittest.TestCase): def testcase_001(self): seq = [5, 9, 8, 2, 1] expected = '6' self.assertEqual(answer(seq), expected) def testcase_002(self): seq = [1, 2, 3, 4, 5, 6, 7,...
none
1
3.053319
3
plugin_example/conversations/utils.py
maquinuz/flask-shop
141
6622553
<reponame>maquinuz/flask-shop from .models import Conversation, Message def get_message_count(user): """Returns the number of private messages of the given user. :param user: The user object. """ return Conversation.query.filter(Conversation.user_id == user.id).count() def get_unread_count(user): ...
from .models import Conversation, Message def get_message_count(user): """Returns the number of private messages of the given user. :param user: The user object. """ return Conversation.query.filter(Conversation.user_id == user.id).count() def get_unread_count(user): """Returns the unread messa...
en
0.717419
Returns the number of private messages of the given user. :param user: The user object. Returns the unread message count for the given user. :param user: The user object. Returns all unread messages for the given user. :param user: The user object.
2.651453
3
train.py
applejenny66/cdQA
0
6622554
# train.py import pandas as pd from ast import literal_eval from cdqa.pipeline import QAPipeline def traing(): df = pd.read_csv('your-custom-corpus-here.csv', converters={'paragraphs': literal_eval}) cdqa_pipeline = QAPipeline(reader='bert_qa_vCPU-sklearn.joblib') cdqa_pipeline.fit_retriever(df=df) c...
# train.py import pandas as pd from ast import literal_eval from cdqa.pipeline import QAPipeline def traing(): df = pd.read_csv('your-custom-corpus-here.csv', converters={'paragraphs': literal_eval}) cdqa_pipeline = QAPipeline(reader='bert_qa_vCPU-sklearn.joblib') cdqa_pipeline.fit_retriever(df=df) c...
en
0.481188
# train.py
2.835958
3
datcore-sdk/python/datcore_sdk/models/create_package_request.py
mguidon/aiohttp-dsm
0
6622555
# coding: utf-8 """ Blackfynn Swagger Swagger documentation for the Blackfynn api # noqa: E501 OpenAPI spec version: 1.0.0 Generated by: https://openapi-generator.tech """ import pprint import re # noqa: F401 import six class CreatePackageRequest(object): """NOTE: This class is auto genera...
# coding: utf-8 """ Blackfynn Swagger Swagger documentation for the Blackfynn api # noqa: E501 OpenAPI spec version: 1.0.0 Generated by: https://openapi-generator.tech """ import pprint import re # noqa: F401 import six class CreatePackageRequest(object): """NOTE: This class is auto genera...
en
0.572739
# coding: utf-8 Blackfynn Swagger Swagger documentation for the Blackfynn api # noqa: E501 OpenAPI spec version: 1.0.0 Generated by: https://openapi-generator.tech # noqa: F401 NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manu...
1.750516
2
Problemas/UT4/Ejercicio 3.1a/solucion.py
JuanFKurucz/TEOCOMP
0
6622556
<filename>Problemas/UT4/Ejercicio 3.1a/solucion.py import random import time def minDeMaxOutput(matriz): comparaciones = 0 asignaciones = 1 min = float('inf') for lista in matriz: comparaciones += 1 asignaciones += 2 max = float('-inf') for i in lista: asign...
<filename>Problemas/UT4/Ejercicio 3.1a/solucion.py import random import time def minDeMaxOutput(matriz): comparaciones = 0 asignaciones = 1 min = float('inf') for lista in matriz: comparaciones += 1 asignaciones += 2 max = float('-inf') for i in lista: asign...
none
1
3.550285
4
rates/views.py
avara1986/currency-api
0
6622557
from django_filters import rest_framework as filters from oauth2_provider.contrib.rest_framework import TokenHasReadWriteScope from rest_framework import viewsets, permissions from rest_framework.decorators import action from rest_framework.response import Response from rates.models import Rate, Currency from rates.se...
from django_filters import rest_framework as filters from oauth2_provider.contrib.rest_framework import TokenHasReadWriteScope from rest_framework import viewsets, permissions from rest_framework.decorators import action from rest_framework.response import Response from rates.models import Rate, Currency from rates.se...
en
0.531826
# ViewSets define the view behavior.
2.117395
2
backend/currency_exchanger/stocks/admin.py
norbertcyran/currency-exchanger
0
6622558
<reponame>norbertcyran/currency-exchanger<filename>backend/currency_exchanger/stocks/admin.py from django.contrib import admin from .models import Stock, StockTransfer admin.site.register(Stock) admin.site.register(StockTransfer)
from django.contrib import admin from .models import Stock, StockTransfer admin.site.register(Stock) admin.site.register(StockTransfer)
none
1
1.197983
1
src/AxisPrediction/Validation.py
zmcx16/AxisTradeCult
35
6622559
from builtins import int from enum import Enum from numpy import NaN import random from sklearn import datasets from sklearn import preprocessing from sklearn.model_selection import train_test_split from sklearn.neighbors import * from sklearn.svm import * from sklearn.naive_bayes import * from sklearn.neural_network ...
from builtins import int from enum import Enum from numpy import NaN import random from sklearn import datasets from sklearn import preprocessing from sklearn.model_selection import train_test_split from sklearn.neighbors import * from sklearn.svm import * from sklearn.naive_bayes import * from sklearn.neural_network ...
en
0.277404
# Binarize the output #clf= OneVsRestClassifier(KNeighborsClassifier(n_neighbors=5)) #clf = OneVsRestClassifier(LinearSVC(random_state=0)) #clf = OneVsRestClassifier(GaussianNB()) #clf = OneVsRestClassifier(MLPClassifier(solver='lbfgs', alpha=1e-5, hidden_layer_sizes=(5, 2), random_state=1)) #clf = OneVsRestClassifier(...
2.339751
2
src/predictor.py
reddelexc/cryptoping-trader
12
6622560
import os import gc import time import joblib import pandas as pd import numpy as np from sklearn.ensemble import RandomForestRegressor from sklearn.metrics import mean_absolute_error, median_absolute_error from datetime import datetime from threading import RLock, Thread from .util import PoolObject, yobit_err, form...
import os import gc import time import joblib import pandas as pd import numpy as np from sklearn.ensemble import RandomForestRegressor from sklearn.metrics import mean_absolute_error, median_absolute_error from datetime import datetime from threading import RLock, Thread from .util import PoolObject, yobit_err, form...
none
1
2.146864
2
aiida_vasp/workchains/tests/test_vasp_wc.py
DropD/aiida_vasp
3
6622561
<reponame>DropD/aiida_vasp<gh_stars>1-10 """ Test submitting a VaspWorkChain. This does not seem to work, for `submit` the daemon will not pick up the workchain and `run` just seems to get stuck after a while. """ # pylint: disable=unused-import,wildcard-import,unused-wildcard-import,unused-argument,redefined-outer-na...
""" Test submitting a VaspWorkChain. This does not seem to work, for `submit` the daemon will not pick up the workchain and `run` just seems to get stuck after a while. """ # pylint: disable=unused-import,wildcard-import,unused-wildcard-import,unused-argument,redefined-outer-name, import-outside-toplevel from __future...
en
0.862167
Test submitting a VaspWorkChain. This does not seem to work, for `submit` the daemon will not pick up the workchain and `run` just seems to get stuck after a while. # pylint: disable=unused-import,wildcard-import,unused-wildcard-import,unused-argument,redefined-outer-name, import-outside-toplevel Test submitting only,...
1.729673
2
learndraw/draw.py
tydcg/pythonlearn
0
6622562
import numpy as np import matplotlib.pyplot as plt from PIL import Image from mpl_toolkits.mplot3d import Axes3D def drawLine(): x = np.linspace(-1, 1, 50) y = 2 * x + 1 plt.figure() plt.plot(x, y) def draw_scatter(): n = 1024 X = np.random.normal(0, 1, 1024) # 正态分布 Y = np.random.norma...
import numpy as np import matplotlib.pyplot as plt from PIL import Image from mpl_toolkits.mplot3d import Axes3D def drawLine(): x = np.linspace(-1, 1, 50) y = 2 * x + 1 plt.figure() plt.plot(x, y) def draw_scatter(): n = 1024 X = np.random.normal(0, 1, 1024) # 正态分布 Y = np.random.norma...
zh
0.481809
# 正态分布 # for color # 定义三维数据 # 作图 # ax3.plot_surface(X, Y, Z, cmap='rainbow') # 定义三维数据 # 作图 # 定义三维数据 # 作图 # ax3.scatter(x, y, z, c='r') # drawLine() # draw_scatter() # plt.show() # draw_image() # draw_image3D()
2.932629
3
HW8/Vaulin/HW8.3.py
kolyasalubov/Lv-677.PythonCore
0
6622563
<reponame>kolyasalubov/Lv-677.PythonCore<filename>HW8/Vaulin/HW8.3.py class Employee: count = 0 def __init__(self, name, salary): Employee.count += 1 self.name = name self.salary = salary @classmethod def counters(cls): return print(f"Employee count = {cls.count}") ...
class Employee: count = 0 def __init__(self, name, salary): Employee.count += 1 self.name = name self.salary = salary @classmethod def counters(cls): return print(f"Employee count = {cls.count}") def total_members(self): return print(f"This is {self.name}. A...
en
0.223698
# print(ivan.total_members())
3.63554
4
salsa/utils/collect_files.py
clairekope/SALSA
3
6622564
from os import listdir import yt from astropy.table import QTable, vstack from mpi4py import MPI import pandas as pd import numpy as np def collect_files(directory, file_ext='.h5', key_words=[], black_list=[]): """ Finds and returns files in a given directory with given extension. Optional key_word and bla...
from os import listdir import yt from astropy.table import QTable, vstack from mpi4py import MPI import pandas as pd import numpy as np def collect_files(directory, file_ext='.h5', key_words=[], black_list=[]): """ Finds and returns files in a given directory with given extension. Optional key_word and bla...
en
0.776793
Finds and returns files in a given directory with given extension. Optional key_word and black_list requirements Parameters ---------- directory : str Directory in which to search for files file_ext : str The file extension to look for (ie '.py', '.h5') key_words : list of str...
2.848157
3
examples/hello/sling/ext/hello/__init__.py
slinghq/sling
6
6622565
__version__ = '0.1.0' from sling import g, logger import sling class HelloResource(object): def on_get(self, req, res): logger.info('Saying hello as module...') res.body = "Hello! I'm ExampleModule." logger.info('Said hello as module!') def test_function(name): logger.info('Test fu...
__version__ = '0.1.0' from sling import g, logger import sling class HelloResource(object): def on_get(self, req, res): logger.info('Saying hello as module...') res.body = "Hello! I'm ExampleModule." logger.info('Said hello as module!') def test_function(name): logger.info('Test fu...
none
1
2.297276
2
src/old/1.py
ytyaru/Python.DataClass.20210701133458
0
6622566
#!/usr/bin/env python3 # coding: utf8 # https://docs.python.org/ja/3.7/library/dataclasses.html # https://docs.python.org/ja/3/library/stdtypes.html # https://www.python.org/dev/peps/pep-0484/ from dataclasses import dataclass, field import typing from typing import Any, Callable, Iterable, Tuple, Optional, List, Tupl...
#!/usr/bin/env python3 # coding: utf8 # https://docs.python.org/ja/3.7/library/dataclasses.html # https://docs.python.org/ja/3/library/stdtypes.html # https://www.python.org/dev/peps/pep-0484/ from dataclasses import dataclass, field import typing from typing import Any, Callable, Iterable, Tuple, Optional, List, Tupl...
en
0.427376
#!/usr/bin/env python3 # coding: utf8 # https://docs.python.org/ja/3.7/library/dataclasses.html # https://docs.python.org/ja/3/library/stdtypes.html # https://www.python.org/dev/peps/pep-0484/ #import re # d: dict = {} # l: list = [] # t: tuple = (,) # s: set = set([1,2,3,4,5]) # fs: frozenset = frozense...
2.781114
3
example/20NewsGroups/example.py
louisgeisler/Doc2Map
14
6622567
from Doc2Map import Doc2Map from sklearn.datasets import fetch_20newsgroups #Doc2Map.test_20newsgroups("test-learn", "all") d2m = Doc2Map(speed="learn", ramification=22) dataset = fetch_20newsgroups(subset='test', shuffle=True, random_state=42) for i, (data, target) in enumerate(zip(dataset.data, dataset.target)): ...
from Doc2Map import Doc2Map from sklearn.datasets import fetch_20newsgroups #Doc2Map.test_20newsgroups("test-learn", "all") d2m = Doc2Map(speed="learn", ramification=22) dataset = fetch_20newsgroups(subset='test', shuffle=True, random_state=42) for i, (data, target) in enumerate(zip(dataset.data, dataset.target)): ...
en
0.206479
#Doc2Map.test_20newsgroups("test-learn", "all")
2.87031
3
Validation/RecoHI/python/selectSimTracks_cff.py
ckamtsikis/cmssw
852
6622568
import FWCore.ParameterSet.Config as cms # Not actually functioning at the moment, use primaryChgSimTracks - <NAME>, 24/7/2013 findableSimTracks = cms.EDFilter("HitPixelLayersTPSelection", src = cms.InputTag("mix","MergedTrackTruth"), tripletSeedOnly = cms.bool(True), chargedOnly = cms.bool(True), signalOnly = ...
import FWCore.ParameterSet.Config as cms # Not actually functioning at the moment, use primaryChgSimTracks - <NAME>, 24/7/2013 findableSimTracks = cms.EDFilter("HitPixelLayersTPSelection", src = cms.InputTag("mix","MergedTrackTruth"), tripletSeedOnly = cms.bool(True), chargedOnly = cms.bool(True), signalOnly = ...
en
0.692675
# Not actually functioning at the moment, use primaryChgSimTracks - <NAME>, 24/7/2013 # for primary particle definition
1.002777
1
scripts/thr_hist_replica.py
dragonboy1994/libhotstuff
0
6622569
import sys import re import argparse import numpy as np from datetime import datetime, timedelta def remove_outliers(x, outlierConstant = 1.5): a = np.array(x) upper_quartile = np.percentile(a, 75) lower_quartile = np.percentile(a, 25) IQR = (upper_quartile - lower_quartile) * outlierConstant quart...
import sys import re import argparse import numpy as np from datetime import datetime, timedelta def remove_outliers(x, outlierConstant = 1.5): a = np.array(x) upper_quartile = np.percentile(a, 75) lower_quartile = np.percentile(a, 25) IQR = (upper_quartile - lower_quartile) * outlierConstant quart...
none
1
2.770854
3
pybb/migrations/0010_auto_20180130_0848.py
stPhoenix/projecttango
0
6622570
<reponame>stPhoenix/projecttango<gh_stars>0 # -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2018-01-30 06:48 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('pybb', '0009_account_accountdeletion_emailaddres...
# -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2018-01-30 06:48 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('pybb', '0009_account_accountdeletion_emailaddress_emailconfirmation_passwordexpiry_passwordh...
en
0.630409
# -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2018-01-30 06:48
1.486246
1
configuration.py
Adrian-Tamas/PythonLibaryFrontend
0
6622571
<gh_stars>0 import configparser configuration = configparser.ConfigParser(allow_no_value=True) configuration.read("config.ini") backend_url = configuration.get("defaults", "backend_url")
import configparser configuration = configparser.ConfigParser(allow_no_value=True) configuration.read("config.ini") backend_url = configuration.get("defaults", "backend_url")
none
1
1.704317
2
djstripe/migrations/0028_auto_20180604_0609.py
ComFreight/cmft-stripe-integration
0
6622572
<gh_stars>0 # Generated by Django 2.0.5 on 2018-06-04 03:09 from django.db import migrations import djstripe.fields import jsonfield.fields class Migration(migrations.Migration): dependencies = [ ('djstripe', '0027_auto_20180528_1111'), ] operations = [ migrations.AlterField( ...
# Generated by Django 2.0.5 on 2018-06-04 03:09 from django.db import migrations import djstripe.fields import jsonfield.fields class Migration(migrations.Migration): dependencies = [ ('djstripe', '0027_auto_20180528_1111'), ] operations = [ migrations.AlterField( model_name...
en
0.671788
# Generated by Django 2.0.5 on 2018-06-04 03:09
2.010469
2
publication/map_helper.py
ahaberlie/SVRIMG
7
6622573
<gh_stars>1-10 import cartopy import cartopy.crs as ccrs import cartopy.io.shapereader as shpreader import cartopy.feature as cfeature import matplotlib.pyplot as plt from matplotlib.colors import ListedColormap, BoundaryNorm from matplotlib.patches import Patch import matplotlib.patheffects as PathEffects import numpy...
import cartopy import cartopy.crs as ccrs import cartopy.io.shapereader as shpreader import cartopy.feature as cfeature import matplotlib.pyplot as plt from matplotlib.colors import ListedColormap, BoundaryNorm from matplotlib.patches import Patch import matplotlib.patheffects as PathEffects import numpy as np def dra...
en
0.321498
Calculate x,y coordinates of each grid cell. Parameters ---------- gx: numeric x coordinates in meshgrid gy: numeric y coordinates in meshgrid Returns ------- (X, Y) ndarray List of coordinates in meshgrid # 0 # 5 # 10 # 15 # 20 # 25 # 30 # 35 # 40 # 45 # 50 # 55 # 60...
2.114252
2
core/engine/validation_helper.py
M-Spencer-94/configNOW
3
6622574
<gh_stars>1-10 # ============================================================================ # # Copyright (c) 2007-2010 Integral Technology Solutions Pty Ltd, # All Rights Reserved. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ...
# ============================================================================ # # Copyright (c) 2007-2010 Integral Technology Solutions Pty Ltd, # All Rights Reserved. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL...
en
0.513793
# ============================================================================ # # Copyright (c) 2007-2010 Integral Technology Solutions Pty Ltd, # All Rights Reserved. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILIT...
2.097093
2
remo/management/commands/savecurrentsensorvalue.py
onsendev/django_iot_workshop_sample
0
6622575
from django.core.management.base import BaseCommand from remo.models import SensorValue from remo.modules.api import NatureRemoApi class Command(BaseCommand): def handle(self, *args, **options): # 追記 # センサーの値をAPIで取得し、SensorValueモデルを1件新たに保存 temperature, humidity, illuminate = NatureRemoApi(...
from django.core.management.base import BaseCommand from remo.models import SensorValue from remo.modules.api import NatureRemoApi class Command(BaseCommand): def handle(self, *args, **options): # 追記 # センサーの値をAPIで取得し、SensorValueモデルを1件新たに保存 temperature, humidity, illuminate = NatureRemoApi(...
ja
0.990657
# 追記 # センサーの値をAPIで取得し、SensorValueモデルを1件新たに保存
1.8568
2
tools/typed/type_gen.py
andyc655/gunyah-hypervisor
61
6622576
#!/usr/bin/env python3 # © 2021 Qualcomm Innovation Center, Inc. All rights reserved. # # 2019 Cog Systems Pty Ltd. # # SPDX-License-Identifier: BSD-3-Clause from lark import Lark from exceptions import RangeError, DSLError from ir import TransformTypes from abi import AArch64ABI import argparse import sys import os ...
#!/usr/bin/env python3 # © 2021 Qualcomm Innovation Center, Inc. All rights reserved. # # 2019 Cog Systems Pty Ltd. # # SPDX-License-Identifier: BSD-3-Clause from lark import Lark from exceptions import RangeError, DSLError from ir import TransformTypes from abi import AArch64ABI import argparse import sys import os ...
en
0.573487
#!/usr/bin/env python3 # © 2021 Qualcomm Innovation Center, Inc. All rights reserved. # # 2019 Cog Systems Pty Ltd. # # SPDX-License-Identifier: BSD-3-Clause # Calling sanity checks # TODO: include Cheetah templates
1.946167
2
ipytv/m3u_tools.py
Beer4Ever83/ipytv
5
6622577
<reponame>Beer4Ever83/ipytv<gh_stars>1-10 #!/usr/env/bin python3 import re import urllib.parse from typing import List from ipytv import M3UPlaylist from ipytv.channel import IPTVChannel, IPTVAttr class M3UDoctor: @staticmethod def fix_split_quoted_string(m3u_rows: List) -> List: """ This cov...
#!/usr/env/bin python3 import re import urllib.parse from typing import List from ipytv import M3UPlaylist from ipytv.channel import IPTVChannel, IPTVAttr class M3UDoctor: @staticmethod def fix_split_quoted_string(m3u_rows: List) -> List: """ This covers the case of rows beginning with double...
en
0.867304
#!/usr/env/bin python3 This covers the case of rows beginning with double quotes that belong to the previous row. Example: #EXTINF:-1 tvg-id="Cinema1 " tvg-name="Cinema1" group-title="Cinema",Cinema One This covers the case of tvg-logo attributes not being correctly url-encoded. ...
3.150235
3
concurrency/tools.py
guesswh0/concurrency
0
6622578
<filename>concurrency/tools.py import logging import sys import time import uuid from functools import wraps def get_logger(): # stdout stream handler out = logging.StreamHandler(sys.stdout) out.setLevel(logging.INFO) out.addFilter(lambda record: record.levelno <= logging.INFO) out.setFormatter(lo...
<filename>concurrency/tools.py import logging import sys import time import uuid from functools import wraps def get_logger(): # stdout stream handler out = logging.StreamHandler(sys.stdout) out.setLevel(logging.INFO) out.addFilter(lambda record: record.levelno <= logging.INFO) out.setFormatter(lo...
en
0.346739
# stdout stream handler # '[%(threadName)10s]' # stderr stream handler # project default logger
2.335464
2
cwmud/core/attributes.py
whutch/cwmud
11
6622579
# -*- coding: utf-8 -*- """Data collections and attributes.""" # Part of Clockwork MUD Server (https://github.com/whutch/cwmud) # :copyright: (c) 2008 - 2017 <NAME> # :license: MIT (https://github.com/whutch/cwmud/blob/master/LICENSE.txt) from collections import abc from .logs import get_logger from .utils import cla...
# -*- coding: utf-8 -*- """Data collections and attributes.""" # Part of Clockwork MUD Server (https://github.com/whutch/cwmud) # :copyright: (c) 2008 - 2017 <NAME> # :license: MIT (https://github.com/whutch/cwmud/blob/master/LICENSE.txt) from collections import abc from .logs import get_logger from .utils import cla...
en
0.806196
# -*- coding: utf-8 -*- Data collections and attributes. # Part of Clockwork MUD Server (https://github.com/whutch/cwmud) # :copyright: (c) 2008 - 2017 <NAME> # :license: MIT (https://github.com/whutch/cwmud/blob/master/LICENSE.txt) Decorate a data blob to register it in this blob. :param str name: The name of...
2.341714
2
train.py
HocRiser01/GEV-NN
0
6622580
<filename>train.py import numpy as np import pandas as pd import torch import torch.nn as nn from torch.utils import data import VAE from config import config import display from construct import construct from sklearn.svm import SVC device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") eps = 1e-8 ...
<filename>train.py import numpy as np import pandas as pd import torch import torch.nn as nn from torch.utils import data import VAE from config import config import display from construct import construct from sklearn.svm import SVC device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") eps = 1e-8 ...
en
0.079498
# if step == 0: # print(epoch, 'kl div:%.4f' % kl_div.item(), 'rec loss:%.4f' % rec_loss.item(), 'dloss:%.4f' % d_loss.item()) # hid = minmaxscaler(hid)
2.556905
3
gs-engine/gse_api_server/app.py
gedge-platform/GEdge-Platform
13
6622581
from flask import Flask from werkzeug.exceptions import HTTPException from controller.service import service from controller.service_mesh import service_mesh from controller.service_schedulehint import service_schedulehint from controller.hpa import hpa from controller.template import template from controller.vpa impo...
from flask import Flask from werkzeug.exceptions import HTTPException from controller.service import service from controller.service_mesh import service_mesh from controller.service_schedulehint import service_schedulehint from controller.hpa import hpa from controller.template import template from controller.vpa impo...
ko
0.222939
# from tools.job import service_ip_collector # from tools.scheduler import Scheduler # sched = Scheduler() # sched.add_schdule(service_ip_collector, 'interval', job_id='service_ip_collector', seconds=5, args=(1, )) apt-get install python3-pymysql apt-get install python3-pandas 실행방법 gunicorn app:app --bind=0.0.0.0:8888 ...
1.94745
2
produce/models.py
jmickela/stalkexchange
0
6622582
<gh_stars>0 from django.db import models from django.utils.translation import ugettext as _ from django.conf import settings class ProduceType(models.Model): title = models.CharField(_('Type'), max_length=255) description = models.TextField(_('Description')) image = models.ImageField(_('Image'), blank=True...
from django.db import models from django.utils.translation import ugettext as _ from django.conf import settings class ProduceType(models.Model): title = models.CharField(_('Type'), max_length=255) description = models.TextField(_('Description')) image = models.ImageField(_('Image'), blank=True) def _...
none
1
2.164297
2
tests/snapshots/snap_test_holidata/test_holidata_produces_holidays_for_locale_and_year[de_BE-2011] 1.py
gour/holidata
32
6622583
<reponame>gour/holidata<filename>tests/snapshots/snap_test_holidata/test_holidata_produces_holidays_for_locale_and_year[de_BE-2011] 1.py [ { 'date': '2011-01-01', 'description': 'Neujahr', 'locale': 'de-BE', 'notes': '', 'region': '', 'type': 'NF' }, { ...
1.py [ { 'date': '2011-01-01', 'description': 'Neujahr', 'locale': 'de-BE', 'notes': '', 'region': '', 'type': 'NF' }, { 'date': '2011-04-24', 'description': 'Ostern', 'locale': 'de-BE', 'notes': '', 'region': '', ...
none
1
1.601555
2
PythonM3/media.py
MiguelTeixeiraUFPB/PythonM3
0
6622584
<filename>PythonM3/media.py def media(*notas): soma=0 tam=len(notas) for nota in notas: soma=soma+nota print('A média de notas é ',soma/(len(notas))) print(f'A quantidade de notas é {tam}') media(5,5,5)
<filename>PythonM3/media.py def media(*notas): soma=0 tam=len(notas) for nota in notas: soma=soma+nota print('A média de notas é ',soma/(len(notas))) print(f'A quantidade de notas é {tam}') media(5,5,5)
none
1
3.111028
3
examples/truncated_square_svd_approximation.py
melven/pitts
2
6622585
#!/usr/bin/env python3 """ Use TT-SVD to approximate a large square SVD """ __authors__ = ['<NAME> <<EMAIL>>'] __date__ = '2020-12-16' import numpy as np import pitts_py import functools import timeit import argparse def timer(func): """measure runtime of the decorated function""" @functools.wraps(func) ...
#!/usr/bin/env python3 """ Use TT-SVD to approximate a large square SVD """ __authors__ = ['<NAME> <<EMAIL>>'] __date__ = '2020-12-16' import numpy as np import pitts_py import functools import timeit import argparse def timer(func): """measure runtime of the decorated function""" @functools.wraps(func) ...
en
0.686847
#!/usr/bin/env python3 Use TT-SVD to approximate a large square SVD measure runtime of the decorated function # generate square random matrix of given rank # 2 = cores[i].shape[1] # 2 = cores[i].shape[1] # 2 = cores[i].shape[1]
2.645765
3
data/test/python/2635cacebbff947f74c9baae1b26d2a5752c15b8present_team.py
harshp8l/deep-learning-lang-detection
84
6622586
from board import present_team from django.views.generic import View from whiteboard_web.observers.present_team_observer import PresentTeamObserver from whiteboard_web.repositories.new_face_repository import NewFaceRepository from whiteboard_web.repositories.team_repository import TeamRepository class PresentTeamDeta...
from board import present_team from django.views.generic import View from whiteboard_web.observers.present_team_observer import PresentTeamObserver from whiteboard_web.repositories.new_face_repository import NewFaceRepository from whiteboard_web.repositories.team_repository import TeamRepository class PresentTeamDeta...
none
1
1.927735
2
benchmark.py
FahmidKader/Rail-Vision-System
0
6622587
<reponame>FahmidKader/Rail-Vision-System<gh_stars>0 #!/usr/bin/env python3 from time import time import numpy as np import cv2 def test(filename='rail.png'): start_time = time() # Loads an image src = cv2.imread(cv2.samples.findFile(filename), cv2.IMREAD_GRAYSCALE) # Check if image is loaded fine ...
#!/usr/bin/env python3 from time import time import numpy as np import cv2 def test(filename='rail.png'): start_time = time() # Loads an image src = cv2.imread(cv2.samples.findFile(filename), cv2.IMREAD_GRAYSCALE) # Check if image is loaded fine if src is None: print('Error opening image!...
en
0.629465
#!/usr/bin/env python3 # Loads an image # Check if image is loaded fine # print('Usage: hough_lines.py [image_name -- default ' + default_file + '] \n') # Copy edges to the images that will display the results in BGR)
2.706606
3
f5/bigip/tm/asm/policies/test/unit/test___init__.py
nghia-tran/f5-common-python
272
6622588
# Copyright 2015 F5 Networks Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
# Copyright 2015 F5 Networks Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
en
0.850922
# Copyright 2015 F5 Networks Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
1.557538
2
validation.py
pupumao/HandwrittenGraphemeClassification
0
6622589
<reponame>pupumao/HandwrittenGraphemeClassification from lib.dataset.dataietr import DataIter from train_config import config from lib.core.model.ShuffleNet_Series.ShuffleNetV2.network import ShuffleNetV2 from lib.core.model.semodel.SeResnet import se_resnet50 import torch import time import argparse import sklearn.met...
from lib.dataset.dataietr import DataIter from train_config import config from lib.core.model.ShuffleNet_Series.ShuffleNetV2.network import ShuffleNetV2 from lib.core.model.semodel.SeResnet import se_resnet50 import torch import time import argparse import sklearn.metrics from tqdm import tqdm import numpy as np import...
en
0.242064
###build model # img_show=np.transpose(img_show[0],axes=[1,2,0]) #print(res) # img_show=img_show.astype(np.uint8) # # img_show=cv2.cvtColor(img_show, cv2.COLOR_BGR2RGB) # cv2.imshow('tmp',img_show) # cv2.waitKey(0) # from collections import OrderedDict # # temp = OrderedDict() # if 'state_dict' in checkpoint: # che...
2.136935
2
bin/geometric-cli.py
Vikicsizmadia/ctp
41
6622590
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import sys import argparse import multiprocessing import numpy as np import torch from torch import nn, Tensor import torch.nn.functional as F from torch_geometric.data import Data as GeometricData, Batch from ctp.util import make_batches from ctp.clutrr im...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import sys import argparse import multiprocessing import numpy as np import torch from torch import nn, Tensor import torch.nn.functional as F from torch_geometric.data import Data as GeometricData, Batch from ctp.util import make_batches from ctp.clutrr im...
en
0.373873
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # PYTHONPATH=. python3 ./bin/geometric-cli.py # --train data/clutrr-emnlp/data_089907f8/*train* # --test data/clutrr-emnlp/data_089907f8/*test* # training params # train_accuracy = test(data.train)
2.110676
2
RL/utils.py
lluissalord/sentiment_trader
7
6622591
<filename>RL/utils.py """ Utils for RL agent """ import numpy as np import collections import os import time from absl import logging from tensorflow import equal as tf_equal from tensorflow import add as tf_add from tensorflow.compat.v2 import summary from gym import spaces from tf_agents.environments import tf_py...
<filename>RL/utils.py """ Utils for RL agent """ import numpy as np import collections import os import time from absl import logging from tensorflow import equal as tf_equal from tensorflow import add as tf_add from tensorflow.compat.v2 import summary from gym import spaces from tf_agents.environments import tf_py...
en
0.749778
Utils for RL agent Create environments for train, validation and test based on their respective DataFrames and properties # Otherwise raise error on evaluating ChosenActionHistogram metric # TODO: Implement Parallel Environment (need tf_agents.system.multiprocessing.enable_interactive_mode() added in github last update...
1.99867
2
www/oldhawaii_metadata/apps/api/utilities.py
oldhawaii/oldhawaii-metadata
1
6622592
#!/usr/bin/env python # -*- coding: utf-8 -*- import json import requests class ResourceApiClient(object): def __init__(self, base_url, resource_type): super(ResourceApiClient, self).__init__() self.base_url = base_url self.resource_type = resource_type def endpoint(self): re...
#!/usr/bin/env python # -*- coding: utf-8 -*- import json import requests class ResourceApiClient(object): def __init__(self, base_url, resource_type): super(ResourceApiClient, self).__init__() self.base_url = base_url self.resource_type = resource_type def endpoint(self): re...
en
0.259407
#!/usr/bin/env python # -*- coding: utf-8 -*- # vim: filetype=python
2.474186
2
SprityBird/spritybird/python3.5/lib/python3.5/site-packages/openpyxl/writer/tests/test_lxml.py
MobileAnalytics/iPython-Framework
4
6622593
<reponame>MobileAnalytics/iPython-Framework<filename>SprityBird/spritybird/python3.5/lib/python3.5/site-packages/openpyxl/writer/tests/test_lxml.py from __future__ import absolute_import # Copyright (c) 2010-2016 openpyxl # stdlib import datetime import decimal from io import BytesIO # package from openpyxl import Wo...
from __future__ import absolute_import # Copyright (c) 2010-2016 openpyxl # stdlib import datetime import decimal from io import BytesIO # package from openpyxl import Workbook from lxml.etree import xmlfile # test imports import pytest from openpyxl.tests.helper import compare_xml @pytest.fixture def worksheet():...
en
0.178695
# Copyright (c) 2010-2016 openpyxl # stdlib # package # test imports <c t="n" r="A1"><v>9781231231230</v></c> <c t="n" r="A1"><v>3.14</v></c> <c t="n" r="A1"><v>1234567890</v></c> <c r="A1"><f>sum(1+1)</f><v></v></c> <c t="b" r="A1"><v>1</v></c> <c t="s" r="A1"><v>0</v></c> <c r="A1" t="s"></c> <c r="A1" t="n"></c> <c ...
2.153184
2
tests/controller/test_cdecontroller.py
aueb-wim/HBPMedical-QCtool
8
6622594
from __future__ import division from __future__ import print_function from __future__ import absolute_import from __future__ import unicode_literals import os import pytest from mipqctool.controller.cdescontroller import CDEsController JSON_PATH1 = 'tests/test_datasets/simple_dc_cdes.json' JSON_PATH2 = 'tests/test_...
from __future__ import division from __future__ import print_function from __future__ import absolute_import from __future__ import unicode_literals import os import pytest from mipqctool.controller.cdescontroller import CDEsController JSON_PATH1 = 'tests/test_datasets/simple_dc_cdes.json' JSON_PATH2 = 'tests/test_...
none
1
2.063974
2
experiment.py
fahadahaf/ZnFIR
2
6622595
import gensim import numpy as np import os import pandas as pd import pdb import pickle import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from argparse import ArgumentParser from fastprogress import progress_bar from gensim.models import Word2Vec from gensim.models.word2vec...
import gensim import numpy as np import os import pandas as pd import pdb import pickle import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from argparse import ArgumentParser from fastprogress import progress_bar from gensim.models import Word2Vec from gensim.models.word2vec...
en
0.319189
# import Function to create custom activations # import Parameter to create custom activations with learnable parameters # import optimizers for demonstrations #local imports ########################################################################################################################### #--------------------...
1.808526
2
parser/parser.py
mapr-demos/stock-exchange
0
6622596
import sys import os def create_directory(dir_path): if not os.path.exists(dir_path): os.mkdir(dir_path) print "Directory " + dir_path + " Created " else: print "Directory " + dir_path + " already exists " create_directory(sys.argv[1]) dir_path = sys.argv[1] + "/stock" create_directo...
import sys import os def create_directory(dir_path): if not os.path.exists(dir_path): os.mkdir(dir_path) print "Directory " + dir_path + " Created " else: print "Directory " + dir_path + " already exists " create_directory(sys.argv[1]) dir_path = sys.argv[1] + "/stock" create_directo...
none
1
3.440932
3
Youtube_videos/random_walk.py
aizardar/WhirlwindTourOfPython
0
6622597
import random def random_walk(n): """ Return coordinates after 'n' block random walk.""" x,y = 0,0 for i in range(n): (dx, dy) = random.choice([(0,1), (0,-1), (1,0), (-1,0)]) x += dx y += dy return (x, y) for i in range(5): walk = random_walk(100000) print(walk, " Distance from origin = ", ...
import random def random_walk(n): """ Return coordinates after 'n' block random walk.""" x,y = 0,0 for i in range(n): (dx, dy) = random.choice([(0,1), (0,-1), (1,0), (-1,0)]) x += dx y += dy return (x, y) for i in range(5): walk = random_walk(100000) print(walk, " Distance from origin = ", ...
en
0.582464
Return coordinates after 'n' block random walk.
4.037637
4
selfservice-api/src/selfservice_api/resources/__init__.py
bcgov/BCSC-BPS
2
6622598
# Copyright © 2019 Province of British Columbia # # 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 agr...
# Copyright © 2019 Province of British Columbia # # 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 agr...
en
0.829993
# Copyright © 2019 Province of British Columbia # # 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 agr...
1.76785
2
fabfile.py
giraldeau/giraldeau.github.io
0
6622599
<filename>fabfile.py from fabric.api import local, run, env, lcd, cd, sudo from fabric.operations import put from fabric.context_managers import shell_env, prefix from fabric.decorators import with_settings env.hosts = ['step.polymtl.ca'] env.user = 'fgiraldeau' homedir = '/home/etudiant/fgiraldeau/' basedir = homedi...
<filename>fabfile.py from fabric.api import local, run, env, lcd, cd, sudo from fabric.operations import put from fabric.context_managers import shell_env, prefix from fabric.decorators import with_settings env.hosts = ['step.polymtl.ca'] env.user = 'fgiraldeau' homedir = '/home/etudiant/fgiraldeau/' basedir = homedi...
none
1
1.556825
2
main.py
RainbowAsteroids/ColorBot
0
6622600
<filename>main.py #https://discordapp.com/api/oauth2/authorize?client_id=592772548949835807&permissions=268503072&scope=bot import discord, asyncio, json, random, os os.chdir(os.path.dirname(os.path.realpath(__file__))) client = discord.Client() token = "" ready = False #When the bot isn't ready, it should be False. ...
<filename>main.py #https://discordapp.com/api/oauth2/authorize?client_id=592772548949835807&permissions=268503072&scope=bot import discord, asyncio, json, random, os os.chdir(os.path.dirname(os.path.realpath(__file__))) client = discord.Client() token = "" ready = False #When the bot isn't ready, it should be False. ...
en
0.808826
#https://discordapp.com/api/oauth2/authorize?client_id=592772548949835807&permissions=268503072&scope=bot #When the bot isn't ready, it should be False. ``` !color is the prefix used help - this text leave - leaves this guild and cleans up invite - bot invite url ``` #Grab the current guilds from the API and the saved ...
2.692407
3
src/database/exceptions.py
pockeleewout/DataCleaner-public
1
6622601
class DataError(Exception): """Base error used by the Data class""" pass class VersionError(DataError): """Base error used by the DataVersion class""" pass class TableError(DataError): """Base error used by the DataTable class""" pass class JoinError(TableError): """Error returned wh...
class DataError(Exception): """Base error used by the Data class""" pass class VersionError(DataError): """Base error used by the DataVersion class""" pass class TableError(DataError): """Base error used by the DataTable class""" pass class JoinError(TableError): """Error returned wh...
en
0.821182
Base error used by the Data class Base error used by the DataVersion class Base error used by the DataTable class Error returned when joining of tables fails
2.349049
2
tests/bindings/python/test_validator.py
0u812/libcellml
0
6622602
# # Tests the Validator class bindings # import unittest class ValidatorTestCase(unittest.TestCase): def test_create_destroy(self): from libcellml import Validator x = Validator() del(x) y = Validator() z = Validator(y) del(y, z) def test_inheritance(self): ...
# # Tests the Validator class bindings # import unittest class ValidatorTestCase(unittest.TestCase): def test_create_destroy(self): from libcellml import Validator x = Validator() del(x) y = Validator() z = Validator(y) del(y, z) def test_inheritance(self): ...
en
0.52646
# # Tests the Validator class bindings # # Test inheritance # Test access to inherited methods # void validateModel(const ModelPtr &model)
2.90983
3
catalog/bindings/csw/time_reference_system.py
NIVANorge/s-enda-playground
0
6622603
from dataclasses import dataclass from bindings.csw.abstract_time_reference_system_type import ( AbstractTimeReferenceSystemType, ) __NAMESPACE__ = "http://www.opengis.net/gml" @dataclass class TimeReferenceSystem(AbstractTimeReferenceSystemType): """ Abstract element serves primarily as the head of a su...
from dataclasses import dataclass from bindings.csw.abstract_time_reference_system_type import ( AbstractTimeReferenceSystemType, ) __NAMESPACE__ = "http://www.opengis.net/gml" @dataclass class TimeReferenceSystem(AbstractTimeReferenceSystemType): """ Abstract element serves primarily as the head of a su...
en
0.882262
Abstract element serves primarily as the head of a substitution group for temporal reference systems.
2.42829
2
Ekeopara_Praise/Phase 1/Python Basic 2/Day21 Tasks/Task1.py
CodedLadiesInnovateTech/-python-challenge-solutions
6
6622604
'''1. Write a Python program to compute and print sum of two given integers (more than or equal to zero). If given integers or the sum have more than 80 digits, print "overflow". Input first integer: 25 Input second integer: 22 Sum of the two integers: 47''' def sum_integers(x, y): if x >= 10 ** 80 or y >= 10 ** ...
'''1. Write a Python program to compute and print sum of two given integers (more than or equal to zero). If given integers or the sum have more than 80 digits, print "overflow". Input first integer: 25 Input second integer: 22 Sum of the two integers: 47''' def sum_integers(x, y): if x >= 10 ** 80 or y >= 10 ** ...
en
0.684714
1. Write a Python program to compute and print sum of two given integers (more than or equal to zero). If given integers or the sum have more than 80 digits, print "overflow". Input first integer: 25 Input second integer: 22 Sum of the two integers: 47
4.236693
4
config.py
Jiuxe/mancala-league
0
6622605
import os basedir = os.path.abspath(os.path.dirname(__file__)) LOG_FILE = os.path.join(basedir, 'log/app_logger.log') CSRF_ENABLED = True SECRET_KEY = '<KEY>' DEBUG = True
import os basedir = os.path.abspath(os.path.dirname(__file__)) LOG_FILE = os.path.join(basedir, 'log/app_logger.log') CSRF_ENABLED = True SECRET_KEY = '<KEY>' DEBUG = True
none
1
1.562431
2
dsul/confidence_intervals/base.py
EdgarTeixeira/eul
0
6622606
<filename>dsul/confidence_intervals/base.py from enum import Enum from dataclasses import dataclass class BootstrapCI(Enum): percentile = 0 normal = 1 bca = 2 class IntervalType(Enum): symmetric = 0 left = 1 right = 2 @dataclass class ConfidenceInterval: lower: float upper: float ...
<filename>dsul/confidence_intervals/base.py from enum import Enum from dataclasses import dataclass class BootstrapCI(Enum): percentile = 0 normal = 1 bca = 2 class IntervalType(Enum): symmetric = 0 left = 1 right = 2 @dataclass class ConfidenceInterval: lower: float upper: float ...
none
1
3.275355
3
nally/core/layers/transport/udp/udp_packet.py
FreibergVlad/port-scanner
0
6622607
import struct from nally.core.layers.packet import Packet from nally.core.layers.transport.transport_layer_utils \ import TransportLayerUtils from nally.core.utils.utils import Utils class UdpPacket(Packet): """ Represents UDP (User Datagram Protocol) datagram """ UDP_HEADER_FORMAT = "!HHHH" ...
import struct from nally.core.layers.packet import Packet from nally.core.layers.transport.transport_layer_utils \ import TransportLayerUtils from nally.core.utils.utils import Utils class UdpPacket(Packet): """ Represents UDP (User Datagram Protocol) datagram """ UDP_HEADER_FORMAT = "!HHHH" ...
en
0.664059
Represents UDP (User Datagram Protocol) datagram Defines UDP header format: * Source port field : 2 bytes * Destination port field : 2 bytes * Length field : 2 bytes * Checksum field : 2 bytes Initializes UDP packet instance :param dest_port: Destination port fie...
2.666261
3
scraper.py
ElijahMwambazi/beforwardScraper
0
6622608
import os import re import time import logging from datetime import datetime import pandas as pd from selenium import webdriver from selenium.webdriver.common.by import By from selenium.common.exceptions import TimeoutException, NoSuchElementException print( "======================================= START =========...
import os import re import time import logging from datetime import datetime import pandas as pd from selenium import webdriver from selenium.webdriver.common.by import By from selenium.common.exceptions import TimeoutException, NoSuchElementException print( "======================================= START =========...
en
0.562079
# Initialize logger. # logging.disable(logging.CRITICAL) # <====== REMEMBER TO COMMENT THIS. # Get location of workign directory. # Create empty list variables that will contain scraped data. # Declare chromedriver options. # Hide window option # Set desired capabilities to ignore SSL stuff. # Set up Chromedriver. # Ch...
2.949302
3
DerinOgrenme/KelimeUret/main.py
onselaydin/pytry
0
6622609
<reponame>onselaydin/pytry<filename>DerinOgrenme/KelimeUret/main.py import os import re import string import requests import numpy as np import collections import random import tensorflow as tf import LSTM min_word_freq = 5 rnn_size = 128 batch_size = 128 learning_rate = 0.001 training_seq_len = 50 embedding_size = r...
import os import re import string import requests import numpy as np import collections import random import tensorflow as tf import LSTM min_word_freq = 5 rnn_size = 128 batch_size = 128 learning_rate = 0.001 training_seq_len = 50 embedding_size = rnn_size prime_texts = ['ankara', 'kitap'] epochs = 10 data_dir = 'd...
uk
0.077952
#{} of {}.'.format(epoch + 1, epochs))
2.552983
3
example.py
williamdean/DockerHubAdmin
0
6622610
#!/usr/bin/env python3 import DockerHubAdmin import argparse parser = argparse.ArgumentParser(description='Python admin interface to Docker Hub') parser.add_argument('-u','--username', help='Admin username for Docker Hub', required=True) parser.add_argument('-p','--password', help='Admin password for Docker Hub', req...
#!/usr/bin/env python3 import DockerHubAdmin import argparse parser = argparse.ArgumentParser(description='Python admin interface to Docker Hub') parser.add_argument('-u','--username', help='Admin username for Docker Hub', required=True) parser.add_argument('-p','--password', help='Admin password for Docker Hub', req...
fr
0.221828
#!/usr/bin/env python3
2.785575
3
code/frameworks/superresolution/train_sr_model.py
wukailu/EDSR-PyTorch
0
6622611
import sys import os sys.path = [os.getcwd()] + sys.path print('current path is ', sys.path) import model print('path for model is ', os.path.realpath(sys.modules['model'].__file__)) from frameworks.superresolution.SRModel import load_model from frameworks.classification.train_single_model import get_params, train_mo...
import sys import os sys.path = [os.getcwd()] + sys.path print('current path is ', sys.path) import model print('path for model is ', os.path.realpath(sys.modules['model'].__file__)) from frameworks.superresolution.SRModel import load_model from frameworks.classification.train_single_model import get_params, train_mo...
none
1
2.195712
2
app/users/migrations/0002_organization_created_at_organization_updated_at.py
thevahidal/hoopoe-core
5
6622612
# Generated by Django 4.0 on 2021-12-23 16:09 from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ('users', '0001_initial'), ] operations = [ migrations.AddField( model_name='organization', ...
# Generated by Django 4.0 on 2021-12-23 16:09 from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ('users', '0001_initial'), ] operations = [ migrations.AddField( model_name='organization', ...
en
0.902068
# Generated by Django 4.0 on 2021-12-23 16:09
1.838587
2
models/multiphase/d2q9_csf/check.py
dlightbody/TCLB
0
6622613
# -*- coding: utf-8 -*- """ Created on Tue Apr 5 14:13:06 2016 @author: mdzik """ from CLB import * import matplotlib.pyplot as plt import numpy as np import bearded_octo_wookie.lbm as lbm from sympy.plotting import * from sympy import * import scipy.optimize as so init_printing() n=Symbol('n') W=Symbol('w') n0=S...
# -*- coding: utf-8 -*- """ Created on Tue Apr 5 14:13:06 2016 @author: mdzik """ from CLB import * import matplotlib.pyplot as plt import numpy as np import bearded_octo_wookie.lbm as lbm from sympy.plotting import * from sympy import * import scipy.optimize as so init_printing() n=Symbol('n') W=Symbol('w') n0=S...
en
0.216943
# -*- coding: utf-8 -*- Created on Tue Apr 5 14:13:06 2016 @author: mdzik # # #X,Y = np.meshgrid(np.arange(256)-128,np.arange(256)-128) #R = np.sqrt(X*X+Y*Y) #R0 = 64 #PHI = phase(R,R0,0.25) #z = -PHI*2. #plt.plot( np.arctanh(z)[128,:] / 2. / 0.25, 'o' ) #plt.plot(R[128,:] - R0) #plt.show() #sfsdf #('k','/home/mdzik/...
2.24014
2
Detectors/UnmergingDetector.py
rothadamg/UPSITE
1
6622614
from SingleStageDetector import SingleStageDetector from ExampleBuilders.UnmergingExampleBuilder import UnmergingExampleBuilder from ExampleWriters.UnmergingExampleWriter import UnmergingExampleWriter from Classifiers.SVMMultiClassClassifier import SVMMultiClassClassifier from Evaluators.AveragingMultiClassEvaluator im...
from SingleStageDetector import SingleStageDetector from ExampleBuilders.UnmergingExampleBuilder import UnmergingExampleBuilder from ExampleWriters.UnmergingExampleWriter import UnmergingExampleWriter from Classifiers.SVMMultiClassClassifier import SVMMultiClassClassifier from Evaluators.AveragingMultiClassEvaluator im...
en
0.58144
Makes valid argument combinations for BioNLP type events.
2.309776
2
moisture_tracers/regrid_common.py
LSaffin/moisture_tracers
0
6622615
<reponame>LSaffin/moisture_tracers """Put all forecast data on a common grid Usage: regrid_common.py <path> <year> <month> <day> <target> Arguments: <path> <year> <month> <day> <target> Options: -h --help Show this screen. """ import datetime import docopt import numpy as np imp...
"""Put all forecast data on a common grid Usage: regrid_common.py <path> <year> <month> <day> <target> Arguments: <path> <year> <month> <day> <target> Options: -h --help Show this screen. """ import datetime import docopt import numpy as np import iris from iris.coords import Di...
en
0.830618
Put all forecast data on a common grid Usage: regrid_common.py <path> <year> <month> <day> <target> Arguments: <path> <year> <month> <day> <target> Options: -h --help Show this screen. We want a cube with the grid spacing of the low_res_cube but restricted to the domain of the...
2.663635
3
programmirovanie/01_the_basics_of_programming/02_pascal/02/fib.py
uldash/stolyarov
0
6622616
<filename>programmirovanie/01_the_basics_of_programming/02_pascal/02/fib.py<gh_stars>0 #!/usr/bin/env python3 fib1 = 1 fib2 = 1 n = input("Номер элемента ряда Фибоначчи: ") n = int(n) i = 0 while i < n - 2: fib_sum = fib1 + fib2 fib1 = fib2 fib2 = fib_sum i = i + 1 print("Значение этого элемента:", f...
<filename>programmirovanie/01_the_basics_of_programming/02_pascal/02/fib.py<gh_stars>0 #!/usr/bin/env python3 fib1 = 1 fib2 = 1 n = input("Номер элемента ряда Фибоначчи: ") n = int(n) i = 0 while i < n - 2: fib_sum = fib1 + fib2 fib1 = fib2 fib2 = fib_sum i = i + 1 print("Значение этого элемента:", f...
fr
0.221828
#!/usr/bin/env python3
3.872893
4
code/StoreProject/storeApp/models.py
nicolasiscoding/IEEEOpenCV2016
0
6622617
from django.db import models from django.core.exceptions import ValidationError from django.core.validators import MinLengthValidator #user entity class User(models.Model): user_id = models.AutoField(primary_key=True, blank = False) def __unicode__(self): return self.user_id user_firstname = models.CharField(max_l...
from django.db import models from django.core.exceptions import ValidationError from django.core.validators import MinLengthValidator #user entity class User(models.Model): user_id = models.AutoField(primary_key=True, blank = False) def __unicode__(self): return self.user_id user_firstname = models.CharField(max_l...
en
0.235996
#user entity #supplier entity #product = models.ManyToManyField(Product) #order entity #product entity #order = models.ManyToManyField(Order) #def __str__(self): # return self.order
2.43452
2
rudolph/rudolph.py
JohnCatn/rpi
0
6622618
#!/usr/bin/python3 import RPi.GPIO as GPIO import time from time import sleep import pygame.mixer # SETUP MIN_DIST = 50.00 ## The distance from the sensor the LED should be brightest MAX_DIST = 100.00 # The distance from the sensor the LED should be on GPIO.setmode(GPIO.BCM) # Use board numbers PIN_TRIGGER = 4 PIN_E...
#!/usr/bin/python3 import RPi.GPIO as GPIO import time from time import sleep import pygame.mixer # SETUP MIN_DIST = 50.00 ## The distance from the sensor the LED should be brightest MAX_DIST = 100.00 # The distance from the sensor the LED should be on GPIO.setmode(GPIO.BCM) # Use board numbers PIN_TRIGGER = 4 PIN_E...
en
0.804408
#!/usr/bin/python3 # SETUP ## The distance from the sensor the LED should be brightest # The distance from the sensor the LED should be on # Use board numbers # Set up distanc sensor # Set up nose LED # create object white for PWM on GPIO port 25 (pin 22) at 100 Hertz # start white led on 0 percent duty cycle (off) # n...
3.292961
3
packaging/setup/plugins/ovirt-engine-common/base/core/reconfigure.py
hbraha/ovirt-engine
347
6622619
# # ovirt-engine-setup -- ovirt engine setup # # Copyright oVirt Authors # SPDX-License-Identifier: Apache-2.0 # # """Reconfigure env plugin.""" import gettext from otopi import constants as otopicons from otopi import plugin from otopi import util from ovirt_engine_setup import constants as osetupcons def _(m)...
# # ovirt-engine-setup -- ovirt engine setup # # Copyright oVirt Authors # SPDX-License-Identifier: Apache-2.0 # # """Reconfigure env plugin.""" import gettext from otopi import constants as otopicons from otopi import plugin from otopi import util from ovirt_engine_setup import constants as osetupcons def _(m)...
en
0.551362
# # ovirt-engine-setup -- ovirt engine setup # # Copyright oVirt Authors # SPDX-License-Identifier: Apache-2.0 # # Reconfigure env plugin. Reconfigure env plugin. # We reset it only if it's disabled. # Can't currently use this code to # disable already-enabled components. # vim: expandtab tabstop=4 shiftwidth=4
1.907053
2
saucelab_api_client/saucelab_api_client.py
Slamnlc/saucelab-api-client
0
6622620
<gh_stars>0 from saucelab_api_client.base_classes.accounts_api import Accounts from saucelab_api_client.base_classes.insights_api import Insights from saucelab_api_client.base_classes.insights_real_devices_api import InsightsRealDeviceApi from saucelab_api_client.base_classes.job_api import JobsApi from saucelab_api_cl...
from saucelab_api_client.base_classes.accounts_api import Accounts from saucelab_api_client.base_classes.insights_api import Insights from saucelab_api_client.base_classes.insights_real_devices_api import InsightsRealDeviceApi from saucelab_api_client.base_classes.job_api import JobsApi from saucelab_api_client.base_cl...
none
1
1.736375
2
1101-1200/1153.string-transforms-into-another-string.py
guangxu-li/leetcode-in-python
0
6622621
<reponame>guangxu-li/leetcode-in-python # # @lc app=leetcode id=1153 lang=python3 # # [1153] String Transforms Into Another String # # @lc code=start class Solution: def canConvert(self, str1: str, str2: str) -> bool: mapping = dict() return ( str1 == str2 or len(set(str2)) ...
# # @lc app=leetcode id=1153 lang=python3 # # [1153] String Transforms Into Another String # # @lc code=start class Solution: def canConvert(self, str1: str, str2: str) -> bool: mapping = dict() return ( str1 == str2 or len(set(str2)) < 26 and all(mapping.setdefa...
en
0.41734
# # @lc app=leetcode id=1153 lang=python3 # # [1153] String Transforms Into Another String # # @lc code=start # @lc code=end
3.586638
4
www/config_default.py
coder-zhuyu/create-python-web-mvc
0
6622622
# encoding: utf-8 configs = { 'debug': True, 'db': { 'host': '192.168.1.104', 'port': 3306, 'user': 'root', 'password': '<PASSWORD>', 'db': 'awesome' }, 'session': { 'secret': 'Awesome' } }
# encoding: utf-8 configs = { 'debug': True, 'db': { 'host': '192.168.1.104', 'port': 3306, 'user': 'root', 'password': '<PASSWORD>', 'db': 'awesome' }, 'session': { 'secret': 'Awesome' } }
en
0.83829
# encoding: utf-8
1.185223
1
cli/token.py
W-DEJONG/Id-manager
1
6622623
import time import click from flask import Blueprint from manager.models import OAuth2Token, OAuth2AuthorizationCode, db bp = Blueprint('token', __name__) bp.cli.help = 'Token maintenance' @bp.cli.command(name='list') def token_list(): """ List access tokens """ tokens = OAuth2Token.query.all() click.e...
import time import click from flask import Blueprint from manager.models import OAuth2Token, OAuth2AuthorizationCode, db bp = Blueprint('token', __name__) bp.cli.help = 'Token maintenance' @bp.cli.command(name='list') def token_list(): """ List access tokens """ tokens = OAuth2Token.query.all() click.e...
en
0.775851
List access tokens Cleanup outdated access tokens and authorization codes.
2.536488
3
publishconf.py
ZoomQuiet/ZoomQuiet.io
4
6622624
#!/usr/bin/env python # -*- coding: utf-8 -*- # from __future__ import unicode_literals # This file is only used if you use `make publish` or # explicitly specify it as your config file. import os import sys sys.path.append(os.curdir) from pelicanconf import * SITEURL = 'https://blog.zoomquiet.io' DISQUS_SITENAME = u...
#!/usr/bin/env python # -*- coding: utf-8 -*- # from __future__ import unicode_literals # This file is only used if you use `make publish` or # explicitly specify it as your config file. import os import sys sys.path.append(os.curdir) from pelicanconf import * SITEURL = 'https://blog.zoomquiet.io' DISQUS_SITENAME = u...
en
0.7129
#!/usr/bin/env python # -*- coding: utf-8 -*- # # This file is only used if you use `make publish` or # explicitly specify it as your config file. #填入你的Shortname #因为嵌套仓库的原因,不能清除发布目录! # Feed generation is usually not desired when developing # Following items are often useful when publishing #DISQUS_SITENAME = "" #GOOGLE...
1.457088
1
q_learning.py
sherlockHSY/FlappyBird-RL
0
6622625
<gh_stars>0 import random import pandas as pd class QLearning(object): def __init__(self, action_space, capacity=100000, learning_rate=0.7, reward_decay=0.95, e_greedy=0.9): super().__init__() self.lr_decay = 0.00003 self.gamma = reward_decay # discount factor 折扣因子 self.lr = learnin...
import random import pandas as pd class QLearning(object): def __init__(self, action_space, capacity=100000, learning_rate=0.7, reward_decay=0.95, e_greedy=0.9): super().__init__() self.lr_decay = 0.00003 self.gamma = reward_decay # discount factor 折扣因子 self.lr = learning_rate ...
zh
0.524786
# discount factor 折扣因子 # 在这个游戏场景下,选择动作为1 即小鸟往上飞的情况并不需要很多,所以当两个动作的价值相同时,我们更倾向于选择 0 动作 # In this environment, we are more inclined to choose action 0 # Eplsion-greedy的方法在这个环境下并不适用,该环境下不需要过多的探索 # Eplsion-greedy is not efficient or required for this agent and environment # if random.random() < self.epsilon: # # 选取Q值最大的...
3.411379
3
test.py
TechStudent11/CostumTk
1
6622626
from UI import Window from tkinter import * class MainWindow(Window): def build(self): Label(self.surface, text="Hello, World!").pack() if __name__ == "__main__": MainWindow(width=70).run()
from UI import Window from tkinter import * class MainWindow(Window): def build(self): Label(self.surface, text="Hello, World!").pack() if __name__ == "__main__": MainWindow(width=70).run()
none
1
3.13006
3
pythonlibs/mantis/fundamental/plugin/p_redis.py
adoggie/Tibet.6
22
6622627
<filename>pythonlibs/mantis/fundamental/plugin/p_redis.py<gh_stars>10-100 #coding:utf-8 from mantis.fundamental.plugin.base import BasePlugin from mantis.fundamental.redis.datasource import CacheManagerRedis class RedisServiceFacet( BasePlugin): def __init__(self,id): BasePlugin.__init__(self,id,'redis') ...
<filename>pythonlibs/mantis/fundamental/plugin/p_redis.py<gh_stars>10-100 #coding:utf-8 from mantis.fundamental.plugin.base import BasePlugin from mantis.fundamental.redis.datasource import CacheManagerRedis class RedisServiceFacet( BasePlugin): def __init__(self,id): BasePlugin.__init__(self,id,'redis') ...
en
0.795494
#coding:utf-8
2.113079
2
wxPySTC_DocMap_v0.2.py
TSN-ADMIN/wxPySTC_DocMap
4
6622628
<filename>wxPySTC_DocMap_v0.2.py import wx import wx.stc as stc ########################################################################################## ########################################################################################## # ZoneRectRounded = True # ZoneRectRoundedRadius = 5 ...
<filename>wxPySTC_DocMap_v0.2.py import wx import wx.stc as stc ########################################################################################## ########################################################################################## # ZoneRectRounded = True # ZoneRectRoundedRadius = 5 ...
en
0.44097
########################################################################################## ########################################################################################## # ZoneRectRounded = True # ZoneRectRoundedRadius = 5 # ZoneRectLineColour = "#0000FF" # ZoneRectLineStyle = 112 # ZoneRectLineWidth = 1 # ...
1.785053
2
puzzler/exact_cover_x2.py
tiwo/puzzler
0
6622629
<reponame>tiwo/puzzler<gh_stars>0 #!/usr/bin/env python # $Id$ # Author: <NAME> <<EMAIL>> # Copyright: (C) 1998-2015 by <NAME>; # portions copyright 2010 by Ali Assaf # License: GPL 2 (see __init__.py) """ An implementation of <NAME>'s 'Algorithm X' [1]_ for the generalized exact cover problem [2]_ using a high-l...
#!/usr/bin/env python # $Id$ # Author: <NAME> <<EMAIL>> # Copyright: (C) 1998-2015 by <NAME>; # portions copyright 2010 by Ali Assaf # License: GPL 2 (see __init__.py) """ An implementation of <NAME>'s 'Algorithm X' [1]_ for the generalized exact cover problem [2]_ using a high-level native data structure techniq...
en
0.740311
#!/usr/bin/env python # $Id$ # Author: <NAME> <<EMAIL>> # Copyright: (C) 1998-2015 by <NAME>; # portions copyright 2010 by Ali Assaf # License: GPL 2 (see __init__.py) An implementation of <NAME>'s 'Algorithm X' [1]_ for the generalized exact cover problem [2]_ using a high-level native data structure technique dev...
3.146862
3
cea/technologies/constants.py
pajotca/CityEnergyAnalyst
1
6622630
""" Constants used throughout the cea.technologies package. History lesson: This is a first step at removing the `cea.globalvars.GlobalVariables` object. """ # Heat Exchangers U_COOL = 2500.0 # W/m2K U_HEAT = 2500.0 # W/m2K DT_HEAT = 5.0 # K - pinch delta at design conditions DT_COOL = 2.0 # K - pinch delta a...
""" Constants used throughout the cea.technologies package. History lesson: This is a first step at removing the `cea.globalvars.GlobalVariables` object. """ # Heat Exchangers U_COOL = 2500.0 # W/m2K U_HEAT = 2500.0 # W/m2K DT_HEAT = 5.0 # K - pinch delta at design conditions DT_COOL = 2.0 # K - pinch delta a...
en
0.797818
Constants used throughout the cea.technologies package. History lesson: This is a first step at removing the `cea.globalvars.GlobalVariables` object. # Heat Exchangers # W/m2K # W/m2K # K - pinch delta at design conditions # K - pinch delta at design conditions # K - minimum difference between cold side outflow and ho...
1.762762
2
airbyte-integrations/connectors/source-slack-singer/source_slack_singer/__init__.py
rajatariya21/airbyte
2
6622631
from .source import SourceSlackSinger __all__ = ["SourceSlackSinger"]
from .source import SourceSlackSinger __all__ = ["SourceSlackSinger"]
none
1
1.037758
1
Elements/ElemLineBase.py
hjabird/XFEM_Boundary_Cooling_Solver
0
6622632
<reponame>hjabird/XFEM_Boundary_Cooling_Solver<filename>Elements/ElemLineBase.py # -*- coding: utf-8 -*- """ @author: <NAME> @copyright Copyright 2016, <NAME> @licence: MIT @status: alpha """ import numpy as np from .ElemBaseClass import ElemBaseClass class ElemLineBase(ElemBaseClass): """ Base class fo...
# -*- coding: utf-8 -*- """ @author: <NAME> @copyright Copyright 2016, <NAME> @licence: MIT @status: alpha """ import numpy as np from .ElemBaseClass import ElemBaseClass class ElemLineBase(ElemBaseClass): """ Base class for 1D line element (-1)------(1) Class adds nd() and gen_gp(...
en
0.588346
# -*- coding: utf-8 -*- @author: <NAME> @copyright Copyright 2016, <NAME> @licence: MIT @status: alpha Base class for 1D line element (-1)------(1) Class adds nd() and gen_gp() # gauss_order should be 1 element tuple.
2.777748
3
src/posts/sitemaps.py
pratik-devkota/notesewa
0
6622633
# core django imports from django.contrib.sitemaps import Sitemap # app imports from posts.models import Post class PostSiteMap(Sitemap): """ A sitemap class indicating the objects, change frequency, and various pages of our website for better search engine indexing """ changefreq = 'weekly' ...
# core django imports from django.contrib.sitemaps import Sitemap # app imports from posts.models import Post class PostSiteMap(Sitemap): """ A sitemap class indicating the objects, change frequency, and various pages of our website for better search engine indexing """ changefreq = 'weekly' ...
en
0.852053
# core django imports # app imports A sitemap class indicating the objects, change frequency, and various pages of our website for better search engine indexing Returns the queryset of objects to include in our sitemap
2.214101
2
auth-center/App/api/user_source/user_list.py
Basic-Components/auth-center
1
6622634
""" 操作User这张表,可以查看,添加或者删除一条记录,修改需要对应的其他resource """ import uuid import datetime import peewee from sanic.views import HTTPMethodView from sanic.response import json from App.model import User, Role from App.decorator import authorized, role_check class UserListSource(HTTPMethodView): """操作User这张表 """ deco...
""" 操作User这张表,可以查看,添加或者删除一条记录,修改需要对应的其他resource """ import uuid import datetime import peewee from sanic.views import HTTPMethodView from sanic.response import json from App.model import User, Role from App.decorator import authorized, role_check class UserListSource(HTTPMethodView): """操作User这张表 """ deco...
zh
0.931657
操作User这张表,可以查看,添加或者删除一条记录,修改需要对应的其他resource 操作User这张表 直接查看User中的全部内容,可以添加参数name查看username为name的用户是否存在 为User表批量添加新的成员,使用inser_many,传入的必须为一个名为users的列表,每个元素包含username和password和main_email 在User表中删除_id在users的用户,users传入的是一串_id列表
2.422012
2
create_dummies.py
InsaneFirebat/SM_Savestates
0
6622635
#!/usr/bin/env python import sys import os if sys.argv[1] == "": print("create_dummies.py <00_file> <ff_file>") sys.exit() else: zero_name = sys.argv[1] ff_name = sys.argv[2] fo_z = open(os.path.dirname(os.path.realpath(__file__)) + "/" + zero_name, "wb") fo_f = open(os.path.dirname(os.path.realpath(__file__)) + ...
#!/usr/bin/env python import sys import os if sys.argv[1] == "": print("create_dummies.py <00_file> <ff_file>") sys.exit() else: zero_name = sys.argv[1] ff_name = sys.argv[2] fo_z = open(os.path.dirname(os.path.realpath(__file__)) + "/" + zero_name, "wb") fo_f = open(os.path.dirname(os.path.realpath(__file__)) + ...
ru
0.26433
#!/usr/bin/env python
2.585008
3
src/gurobi_cases/dense.py
bingrao/cache_managment
0
6622636
# This example formulates and solves the following simple QP model: # # minimize x + y + x^2 + x*y + y^2 + y*z + z^2 # subject to x + 2 y + 3 z >= 4 # x + y >= 1 # x, y, z non-negative # # The example illustrates the use of dense matrices to store A and Q # (and d...
# This example formulates and solves the following simple QP model: # # minimize x + y + x^2 + x*y + y^2 + y*z + z^2 # subject to x + 2 y + 3 z >= 4 # x + y >= 1 # x, y, z non-negative # # The example illustrates the use of dense matrices to store A and Q # (and d...
en
0.675378
# This example formulates and solves the following simple QP model: # # minimize x + y + x^2 + x*y + y^2 + y*z + z^2 # subject to x + 2 y + 3 z >= 4 # x + y >= 1 # x, y, z non-negative # # The example illustrates the use of dense matrices to store A and Q # (and dense vec...
2.845248
3
OSX-replace-chars-in-iPhoto.py
bitounu/shitz
0
6622637
#!/usr/bin/python # -*- coding: utf-8 -*- import EasyDialogs import os def gdzie_zapisac(): # ask for destination folder dir = EasyDialogs.AskFolder( message='Select destinatin folder', defaultLocation=os.getcwd(), wanted=unicode, ) return dir def napraw_nazwy(album): # loop for ZNAKI table ZNAKI = [...
#!/usr/bin/python # -*- coding: utf-8 -*- import EasyDialogs import os def gdzie_zapisac(): # ask for destination folder dir = EasyDialogs.AskFolder( message='Select destinatin folder', defaultLocation=os.getcwd(), wanted=unicode, ) return dir def napraw_nazwy(album): # loop for ZNAKI table ZNAKI = [...
en
0.748161
#!/usr/bin/python # -*- coding: utf-8 -*- # ask for destination folder # loop for ZNAKI table # variable name for particular album # link to its value with eval() # replacing characters in albums name # ALBUMPATH = os.path.join(dir,ALBUM) # path to folder # create folder
3.04568
3
src/medigan/constants.py
RichardObi/medigan
2
6622638
# -*- coding: utf-8 -*- # ! /usr/bin/env python """Global constants of the medigan library .. codeauthor:: <NAME> <<EMAIL>> .. codeauthor:: <NAME> <<EMAIL>> """ """ Static link to the config of medigan. Note: To add a model, please create pull request in this github repo. """ CONFIG_FILE_URL = "https://raw.githubuser...
# -*- coding: utf-8 -*- # ! /usr/bin/env python """Global constants of the medigan library .. codeauthor:: <NAME> <<EMAIL>> .. codeauthor:: <NAME> <<EMAIL>> """ """ Static link to the config of medigan. Note: To add a model, please create pull request in this github repo. """ CONFIG_FILE_URL = "https://raw.githubuser...
en
0.902822
# -*- coding: utf-8 -*- # ! /usr/bin/env python Global constants of the medigan library .. codeauthor:: <NAME> <<EMAIL>> .. codeauthor:: <NAME> <<EMAIL>> Static link to the config of medigan. Note: To add a model, please create pull request in this github repo. Folder path that will be created to locally store the con...
1.824188
2
dbtsdk/Dbt.py
Nilpo/dbt-sdk-python
1
6622639
<reponame>Nilpo/dbt-sdk-python #!/usr/bin/env python3 """ DBT API Client SDK for DPT API v2 Copyright (c) 2018 <NAME> (https://robdunham.info) This software is available under the MIT license. See http://opensource.org/licenses/MIT for more info. Documentation for DBT API calls is located at http://www.digitalbiblep...
#!/usr/bin/env python3 """ DBT API Client SDK for DPT API v2 Copyright (c) 2018 <NAME> (https://robdunham.info) This software is available under the MIT license. See http://opensource.org/licenses/MIT for more info. Documentation for DBT API calls is located at http://www.digitalbibleplatform.com/docs/ This is a Py...
en
0.747297
#!/usr/bin/env python3 DBT API Client SDK for DPT API v2 Copyright (c) 2018 <NAME> (https://robdunham.info) This software is available under the MIT license. See http://opensource.org/licenses/MIT for more info. Documentation for DBT API calls is located at http://www.digitalbibleplatform.com/docs/ This is a Python...
2.364858
2
example/app.py
zhzLuke96/Yoi
0
6622640
<gh_stars>0 from werkzeug.wrappers import Request, Response @Request.application def application(environ,request): # from pprint import pprint;pprint(environ) name = request.args.get("name","PyCon") return Response([f'<h1>hello {name}!</h1>']) if __name__ == '__main__': from wsgiref.simple_server im...
from werkzeug.wrappers import Request, Response @Request.application def application(environ,request): # from pprint import pprint;pprint(environ) name = request.args.get("name","PyCon") return Response([f'<h1>hello {name}!</h1>']) if __name__ == '__main__': from wsgiref.simple_server import make_ser...
en
0.289905
# from pprint import pprint;pprint(environ) # httpd = make_server("127.0.0.1", 8000, app)
2.260515
2
typhon/objects/signals.py
monte-language/typhon
63
6622641
from rpython.rlib.rarithmetic import intmask from typhon.atoms import getAtom from typhon.autohelp import autohelp, method from typhon.objects.root import Object from typhon.objects.collections.maps import EMPTY_MAP from typhon.objects.data import IntObject from typhon.ruv import (alloc_signal, free, SignalStart, Sig...
from rpython.rlib.rarithmetic import intmask from typhon.atoms import getAtom from typhon.autohelp import autohelp, method from typhon.objects.root import Object from typhon.objects.collections.maps import EMPTY_MAP from typhon.objects.data import IntObject from typhon.ruv import (alloc_signal, free, SignalStart, Sig...
none
1
2.082384
2
ando/tools/generator/tests/test_AnDOGenerator.py
catalystneuro/AnDO
1
6622642
<reponame>catalystneuro/AnDO<filename>ando/tools/generator/tests/test_AnDOGenerator.py import unittest from ando.tools.generator.AnDOGenerator import * from ando.tools.generator.tests.utils import * class Test_AnDOData(unittest.TestCase): def setUp(self): test_dir = Path(initialize_test_directory(clean=T...
import unittest from ando.tools.generator.AnDOGenerator import * from ando.tools.generator.tests.utils import * class Test_AnDOData(unittest.TestCase): def setUp(self): test_dir = Path(initialize_test_directory(clean=True)) self.sub_id = 'sub5' self.ses_id = 'ses1' self.tasks = N...
en
0.91793
# extract all paths that exist in the test directory # find path that is corresponding to each line of the csv file # iterate through sessions
2.461265
2
git.py
miguelvelezmj25/fabfiles
1
6622643
<reponame>miguelvelezmj25/fabfiles from common import * def git_clone(repo, options=None, name=None, dir="."): with cd(dir): command = 'git clone ' if options is not None: command += '{} '.format(options) command += '{} '.format(repo) if name is not None: ...
from common import * def git_clone(repo, options=None, name=None, dir="."): with cd(dir): command = 'git clone ' if options is not None: command += '{} '.format(options) command += '{} '.format(repo) if name is not None: command += '{} '.format(name) ...
none
1
2.468868
2
preprocess.py
freesinger/readmission_prediction
4
6622644
import numpy as np import pandas as pd import scipy.stats as sp # file path DATA_DIR = "./data" ORI_DATA_PATH = DATA_DIR + "/diabetic_data.csv" MAP_PATH = DATA_DIR + "/IDs_mapping.csv" OUTPUT_DATA_PATH = DATA_DIR + "/preprocessed_data.csv" # load data dataframe_ori = pd.read_csv(ORI_DATA_PATH) NUM_RECORDS = dataframe...
import numpy as np import pandas as pd import scipy.stats as sp # file path DATA_DIR = "./data" ORI_DATA_PATH = DATA_DIR + "/diabetic_data.csv" MAP_PATH = DATA_DIR + "/IDs_mapping.csv" OUTPUT_DATA_PATH = DATA_DIR + "/preprocessed_data.csv" # load data dataframe_ori = pd.read_csv(ORI_DATA_PATH) NUM_RECORDS = dataframe...
en
0.765105
# file path # load data # make a copy of the dataframe for preprocessing # Drop features # drop bad data with 3 '?' in diag # drop died patient data which 'discharge_disposition_id' == 11 | 19 | 20 | 21 indicates 'Expired' # drop 3 data with 'Unknown/Invalid' gender # process readmitted data # cnt0, cnt1, cnt2 = 0, 0, ...
3.015893
3
jazzband/content.py
tipabu/jazzband-website
0
6622645
<filename>jazzband/content.py import babel.dates from flask import ( Blueprint, Response, current_app, render_template, redirect, request, url_for, send_from_directory, safe_join, ) from flask_flatpages import FlatPages from flask_login import current_user from pyatom import AtomFeed...
<filename>jazzband/content.py import babel.dates from flask import ( Blueprint, Response, current_app, render_template, redirect, request, url_for, send_from_directory, safe_join, ) from flask_flatpages import FlatPages from flask_login import current_user from pyatom import AtomFeed...
es
0.481087
#security")
2.085305
2
RTplzrunBlog/InputOutput/2446.py
lkc263/Algorithm_Study_Python
0
6622646
n = int(input()) cnt_idx = 0 for idx in range(n, 0, -1): print(" " * cnt_idx + "*" * (2 * idx - 1)) cnt_idx += 1 cnt_idx -= 1 for idx in range(2, n + 1): cnt_idx -= 1 print(" " * cnt_idx + "*" * (2 * idx - 1))
n = int(input()) cnt_idx = 0 for idx in range(n, 0, -1): print(" " * cnt_idx + "*" * (2 * idx - 1)) cnt_idx += 1 cnt_idx -= 1 for idx in range(2, n + 1): cnt_idx -= 1 print(" " * cnt_idx + "*" * (2 * idx - 1))
none
1
3.46062
3
Day_16.py
iamakkkhil/DailyCoding
8
6622647
""" DAY 16 : Different Operations on Matrices. https://www.geeksforgeeks.org/different-operation-matrices/ QUESTION : Perform Addititon, Subtraction and Multiplication on given Matrices. """ def add(matrix1, matrix2, n1, m1, n2, m2): # n = no of rows # m = no of columns add = [] if n1 =...
""" DAY 16 : Different Operations on Matrices. https://www.geeksforgeeks.org/different-operation-matrices/ QUESTION : Perform Addititon, Subtraction and Multiplication on given Matrices. """ def add(matrix1, matrix2, n1, m1, n2, m2): # n = no of rows # m = no of columns add = [] if n1 =...
en
0.67482
DAY 16 : Different Operations on Matrices. https://www.geeksforgeeks.org/different-operation-matrices/ QUESTION : Perform Addititon, Subtraction and Multiplication on given Matrices. # n = no of rows # m = no of columns # n = no of rows # m = no of columns # n = no of rows # m = no of columns
4.004066
4
run_segmentation.py
cansik/DPT
1
6622648
"""Compute segmentation maps for images in the input folder. """ import os import glob import cv2 import argparse import numpy as np import torch import torch.nn.functional as F import tqdm import util.io from util.io import get_images_in_path from torchvision.transforms import Compose from dpt.models import DPTSegm...
"""Compute segmentation maps for images in the input folder. """ import os import glob import cv2 import argparse import numpy as np import torch import torch.nn.functional as F import tqdm import util.io from util.io import get_images_in_path from torchvision.transforms import Compose from dpt.models import DPTSegm...
en
0.487574
Compute segmentation maps for images in the input folder. Run segmentation network Args: input_path (str): path to input folder output_path (str): path to output folder model_path (str): path to saved model # select device # load network # get input # create output folder # print(" process...
2.408037
2
ex054.py
ezequielwish/Python3
1
6622649
<reponame>ezequielwish/Python3 # Crie um programa que leia o ano de nascimento de sete pessoas. No final, # mostre quantas pessoas ainda não atingiram a maioridade e quantas já são maiores. from datetime import datetime year = datetime.now().year majors = 0 minors = 0 for people in range(1, 8): birth = int(input(...
# Crie um programa que leia o ano de nascimento de sete pessoas. No final, # mostre quantas pessoas ainda não atingiram a maioridade e quantas já são maiores. from datetime import datetime year = datetime.now().year majors = 0 minors = 0 for people in range(1, 8): birth = int(input(f'Data de nascimento da {people...
pt
0.998296
# Crie um programa que leia o ano de nascimento de sete pessoas. No final, # mostre quantas pessoas ainda não atingiram a maioridade e quantas já são maiores.
4.198824
4
new-component.py
syncush/react-boilerplate-cli
1
6622650
<gh_stars>1-10 import sys import os name_string = "$componentName" styles_extention_token = "$styleExtention" dir_path = os.path.dirname(os.path.realpath(__file__)) template_dir = os.path.join(dir_path, "templates") components_dir = os.path.join(template_dir, "components") cwd = os.getcwd() input_name = sys.argv[-1]...
import sys import os name_string = "$componentName" styles_extention_token = "$styleExtention" dir_path = os.path.dirname(os.path.realpath(__file__)) template_dir = os.path.join(dir_path, "templates") components_dir = os.path.join(template_dir, "components") cwd = os.getcwd() input_name = sys.argv[-1] component_dir ...
none
1
2.545078
3