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
app/schemas/cost.py
code-lab-org/ise-design
0
6625051
<filename>app/schemas/cost.py<gh_stars>0 from fastapi_utils.api_model import APIModel from pydantic import Field from typing import List, Dict class BillOfMaterialsLine(APIModel): name: str = Field( ..., description="Material name." ) cost: float = Field( ..., description="U...
<filename>app/schemas/cost.py<gh_stars>0 from fastapi_utils.api_model import APIModel from pydantic import Field from typing import List, Dict class BillOfMaterialsLine(APIModel): name: str = Field( ..., description="Material name." ) cost: float = Field( ..., description="U...
none
1
2.217964
2
fin dashboard/fin_dash.py
queeniekwan/Seaquake
0
6625052
<reponame>queeniekwan/Seaquake<filename>fin dashboard/fin_dash.py<gh_stars>0 import pandas as pd import json from datetime import datetime, timedelta def clean_data(df): ''' filter and edit raw data into clean data ''' # filter out rows where entry_trade_size_asset != exit_trade_size_asset; entry_trade_size_do...
dashboard/fin_dash.py<gh_stars>0 import pandas as pd import json from datetime import datetime, timedelta def clean_data(df): ''' filter and edit raw data into clean data ''' # filter out rows where entry_trade_size_asset != exit_trade_size_asset; entry_trade_size_dollar = 0; exit_trade_size_dollar = 0 df ...
en
0.524126
filter and edit raw data into clean data # filter out rows where entry_trade_size_asset != exit_trade_size_asset; entry_trade_size_dollar = 0; exit_trade_size_dollar = 0 # convert time columns to datetime object # add market_made_type # add hold time (seconds) apply condition for market_made_type create and return the ...
2.902232
3
NLP/Text/topic_modeler.py
KzlvA/STT-TTS-LM-Toolkit
1
6625053
from nltk.tokenize import RegexpTokenizer from nltk.corpus import stopwords from nltk.stem.snowball import SnowballStemmer from gensim import models, corpora # Load input data def load_data(input_file): data = [] with open(input_file, 'r') as f: for line in f.readlines(): data.append(line[:...
from nltk.tokenize import RegexpTokenizer from nltk.corpus import stopwords from nltk.stem.snowball import SnowballStemmer from gensim import models, corpora # Load input data def load_data(input_file): data = [] with open(input_file, 'r') as f: for line in f.readlines(): data.append(line[:...
en
0.711009
# Load input data # Processor function for tokenizing, removing stop # words, and stemming # Create a regular expression tokenizer # Create a Snowball stemmer # Get the list of stop words # Tokenize the input string # Remove the stop words # Perform stemming on the tokenized words # Load input data # Create a list for ...
3.297028
3
src/foremast/utils/banners.py
dnava013/foremast
157
6625054
<gh_stars>100-1000 # Foremast - Pipeline Tooling # # Copyright 2018 Gogo, 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 # ...
# Foremast - Pipeline Tooling # # Copyright 2018 Gogo, 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...
en
0.752494
# Foremast - Pipeline Tooling # # Copyright 2018 Gogo, 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...
2.411733
2
eqcharinfo/controllers/charfile_ingest.py
Preocts/eqcharinfo
0
6625055
"""Controller for ingest and parsing of character files""" import logging import re from configparser import ConfigParser from pathlib import Path class CharfileIngest: HEADER_PATTERN = r"\bLocation\sName\sID\sCount\sSlots\b" ROW_PATTERN = r"^.*?\s.*?\s[0-9]*?\s[0-9]*?\s[0-9]*?$" def __init__(self, confi...
"""Controller for ingest and parsing of character files""" import logging import re from configparser import ConfigParser from pathlib import Path class CharfileIngest: HEADER_PATTERN = r"\bLocation\sName\sID\sCount\sSlots\b" ROW_PATTERN = r"^.*?\s.*?\s[0-9]*?\s[0-9]*?\s[0-9]*?$" def __init__(self, confi...
en
0.670484
Controller for ingest and parsing of character files Returns filename:content on success, empty dict on failure Extract filename from webform, returns empty string on failure Extract file body from webform, returns empty string on failure Saves loaded charfile(s) to disk Replaces spaces with underscores
2.975686
3
custom_components/kia_uvo/config_flow.py
ManCaveMedia/kia_uvo
0
6625056
<filename>custom_components/kia_uvo/config_flow.py import logging import voluptuous as vol import uuid import requests from urllib.parse import parse_qs, urlparse from homeassistant import config_entries from homeassistant.const import CONF_PASSWORD, CONF_USERNAME, CONF_UNIT_OF_MEASUREMENT, CONF_UNIT_SYSTEM from home...
<filename>custom_components/kia_uvo/config_flow.py import logging import voluptuous as vol import uuid import requests from urllib.parse import parse_qs, urlparse from homeassistant import config_entries from homeassistant.const import CONF_PASSWORD, CONF_USERNAME, CONF_UNIT_OF_MEASUREMENT, CONF_UNIT_SYSTEM from home...
none
1
2.022416
2
MyExpenses/myexpenses/admin.py
mainyanim/MyExpenses
0
6625057
from django.contrib import admin from .models import * admin.site.register(Expense) admin.site.register(Note)
from django.contrib import admin from .models import * admin.site.register(Expense) admin.site.register(Note)
none
1
1.184669
1
core/views.py
dudonwai/dota_stats_py
0
6625058
from django.shortcuts import render from django.views.generic.base import TemplateView from django.views.generic.list import ListView from django.views.generic.detail import DetailView import core.models as coremodels # Landing Page for Index class LandingView(TemplateView): template_name = "blog/index.html" # Te...
from django.shortcuts import render from django.views.generic.base import TemplateView from django.views.generic.list import ListView from django.views.generic.detail import DetailView import core.models as coremodels # Landing Page for Index class LandingView(TemplateView): template_name = "blog/index.html" # Te...
en
0.701073
# Landing Page for Index # Template for About, Archive, Contact
1.589244
2
MMMaker/app/memes/migrations/0003_auto_20200616_1316.py
C4Ution/MMMaker
9
6625059
# Generated by Django 2.2.12 on 2020-06-16 13:16 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('memes', '0002_auto_20200616_1314'), ] operations = [ migrations.RenameField( model_name='taskresource', old_name='url', ...
# Generated by Django 2.2.12 on 2020-06-16 13:16 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('memes', '0002_auto_20200616_1314'), ] operations = [ migrations.RenameField( model_name='taskresource', old_name='url', ...
en
0.725987
# Generated by Django 2.2.12 on 2020-06-16 13:16
1.532401
2
timestack/base.py
acomphealth/timestack
0
6625060
def math_func(x): return x + 1
def math_func(x): return x + 1
none
1
1.373162
1
version.py
NickBayard/MLH
0
6625061
__version__ = '1.1' if __name__ == '__main__': print('Version: {}'.format(__version__))
__version__ = '1.1' if __name__ == '__main__': print('Version: {}'.format(__version__))
none
1
1.565319
2
setup.py
joferkington/seismic_plotting
20
6625062
<reponame>joferkington/seismic_plotting from setuptools import setup setup( name = 'seismic_plotting', version = '0.1', description = "Cross Section Plotting with Geoprobe Datasets", author = '<NAME>', author_email = '<EMAIL>', license = 'LICENSE', install_requires = [ 'matplotlib >...
from setuptools import setup setup( name = 'seismic_plotting', version = '0.1', description = "Cross Section Plotting with Geoprobe Datasets", author = '<NAME>', author_email = '<EMAIL>', license = 'LICENSE', install_requires = [ 'matplotlib >= 0.98', 'numpy >= 1.1', ...
none
1
1.15787
1
surl/helpers/log.py
LarryPavanery/surl
0
6625063
<reponame>LarryPavanery/surl # -*- encoding: utf-8 -*- ''' __author__ = "Larry_Pavanery ''' from datetime import datetime as dt import surl.helpers.shared as util class Log(object): def __init__(self, class_name): self.log_enable = util.log_enable() self.class_name = class_name def _print(se...
# -*- encoding: utf-8 -*- ''' __author__ = "Larry_Pavanery ''' from datetime import datetime as dt import surl.helpers.shared as util class Log(object): def __init__(self, class_name): self.log_enable = util.log_enable() self.class_name = class_name def _print(self, level, content): ...
en
0.661129
# -*- encoding: utf-8 -*- __author__ = "Larry_Pavanery
2.450597
2
neural_networks/get_new_weight_inc.py
Yao-Shao/Maching-Learning-only-with-Numpy
1
6625064
import numpy as np def get_new_weight_inc(weight_inc, weight, momW, wc, lr, weight_grad): ''' Get new increment weight, the update weight policy. inputs: weight_inc: old increment weights weight: old weights momW: weight momentum ...
import numpy as np def get_new_weight_inc(weight_inc, weight, momW, wc, lr, weight_grad): ''' Get new increment weight, the update weight policy. inputs: weight_inc: old increment weights weight: old weights momW: weight momentum ...
en
0.742485
Get new increment weight, the update weight policy. inputs: weight_inc: old increment weights weight: old weights momW: weight momentum wc: weight decay lr: learning rate weight_grad: ...
2.832914
3
neutron/agent/ovsdb/native/helpers.py
ISCAS-VDI/neutron-base
1
6625065
# Copyright (c) 2015 Red Hat, 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 ...
# Copyright (c) 2015 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
en
0.854798
# Copyright (c) 2015 Red Hat, 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 ...
1.480494
1
userbot/modules/filemanager.py
tiararosebiezetta/WeebProject-fork
0
6625066
# Credits to Userge for Remove and Rename import io import os import os.path import shutil import time from datetime import datetime from os.path import basename, dirname, exists, isdir, isfile, join, relpath, splitext from shutil import rmtree from tarfile import TarFile, is_tarfile from zipfile import BadZipFile, Zi...
# Credits to Userge for Remove and Rename import io import os import os.path import shutil import time from datetime import datetime from os.path import basename, dirname, exists, isdir, isfile, join, relpath, splitext from shutil import rmtree from tarfile import TarFile, is_tarfile from zipfile import BadZipFile, Zi...
en
0.931091
# Credits to Userge for Remove and Rename Removing Directory/File Renaming Directory/File
2.308216
2
dependencies/src/4Suite-XML-1.0.2/test/Xml/Xslt/Borrowed/gkh_20000804.py
aleasims/Peach
0
6625067
#G. <NAME>'s <<EMAIL>> node-set intersection and difference example from Xml.Xslt import test_harness sheet_and_source = """<?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:data="ken" version="1.0"> <xsl:output method="text"/> <data:data>...
#G. <NAME>'s <<EMAIL>> node-set intersection and difference example from Xml.Xslt import test_harness sheet_and_source = """<?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:data="ken" version="1.0"> <xsl:output method="text"/> <data:data>...
en
0.16465
#G. <NAME>'s <<EMAIL>> node-set intersection and difference example <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:data="ken" version="1.0"> <xsl:output method="text"/> <data:data> <item>1</item> <item>2</item> <item>3</item> ...
2.914747
3
docassemble_base/docassemble/base/__init__.py
foxbat123/docassemble
1
6625068
try: __import__('pkg_resources').declare_namespace(__name__) except ImportError: __path__ = __import__('pkgutil').extend_path(__path__, __name__) __version__ = "1.3.9"
try: __import__('pkg_resources').declare_namespace(__name__) except ImportError: __path__ = __import__('pkgutil').extend_path(__path__, __name__) __version__ = "1.3.9"
none
1
1.406548
1
sympy/physics/units/tests/test_quantities.py
ripper479/sympy
0
6625069
<reponame>ripper479/sympy<gh_stars>0 from sympy import (Abs, Add, Basic, Function, Number, Rational, S, Symbol, diff, exp, integrate, log, sin, sqrt, symbols, Matrix) from sympy.physics.units import (amount_of_substance, convert_to, find_unit, volume, kilometer) from ...
from sympy import (Abs, Add, Basic, Function, Number, Rational, S, Symbol, diff, exp, integrate, log, sin, sqrt, symbols, Matrix) from sympy.physics.units import (amount_of_substance, convert_to, find_unit, volume, kilometer) from sympy.physics.units.definitions impor...
en
0.731869
# simple test # TODO: eventually support this kind of conversion: # assert (2*speed_of_light).convert_to(m / s) == 2 * 299792458 * m / s # Wrong dimension to convert: # TODO: eventually add this: # assert (u + v).convert_to(u) == (1 + S.Half)*u # TODO: eventually add this: # assert (u - v).convert_to(u) == S.Half*u # P...
2.787044
3
tests/conftest.py
zosocanuck/connaisseur
0
6625070
<gh_stars>0 import re import json import pytest import requests from aioresponses import CallbackResult import connaisseur.kube_api import connaisseur.config as co import connaisseur.admission_request as admreq import connaisseur.alert as alert import connaisseur.validators.notaryv1.trust_data as td import connaisseur....
import re import json import pytest import requests from aioresponses import CallbackResult import connaisseur.kube_api import connaisseur.config as co import connaisseur.admission_request as admreq import connaisseur.alert as alert import connaisseur.validators.notaryv1.trust_data as td import connaisseur.validators.n...
en
0.733761
This file is used for sharing fixtures across all other test files. https://docs.pytest.org/en/stable/fixture.html#scope-sharing-fixtures-across-classes-modules-packages-or-session
1.944878
2
docassemble_base/docassemble/base/filter.py
Hamudss/docassemble
0
6625071
<filename>docassemble_base/docassemble/base/filter.py # -*- coding: utf-8 -*- import sys from six import string_types, text_type, PY2 import re import os import markdown import mimetypes import codecs import json import qrcode import qrcode.image.svg from io import BytesIO import tempfile import types import time impor...
<filename>docassemble_base/docassemble/base/filter.py # -*- coding: utf-8 -*- import sys from six import string_types, text_type, PY2 import re import os import markdown import mimetypes import codecs import json import qrcode import qrcode.image.svg from io import BytesIO import tempfile import types import time impor...
en
0.195609
# -*- coding: utf-8 -*- # def blank_da_send_mail(*args, **kwargs): # logmessage("da_send_mail: no mail agent configured!") # return(None) # da_send_mail = blank_da_send_mail # def set_da_send_mail(func): # global da_send_mail # da_send_mail = func # return # def blank_file_finder(*args, **kwargs): #...
2.030011
2
face_recognition_final_year/user_manager_app/views.py
chiragsaraswat/automated_authentication_system_using_face_recognition
0
6625072
from django.shortcuts import render, redirect from .forms import NewUserForm from django.contrib.auth import login, authenticate, logout from django.contrib import messages from django.contrib.auth.forms import AuthenticationForm from .models import Attendance from django.http import HttpResponse # Create your view...
from django.shortcuts import render, redirect from .forms import NewUserForm from django.contrib.auth import login, authenticate, logout from django.contrib import messages from django.contrib.auth.forms import AuthenticationForm from .models import Attendance from django.http import HttpResponse # Create your view...
en
0.968116
# Create your views here.
2.295524
2
boofuzz/boofuzz/sex.py
youngcraft/boofuzz-modbus
23
6625073
<reponame>youngcraft/boofuzz-modbus import attr # Sulley EXception Class class BoofuzzError(Exception): pass class BoofuzzRestartFailedError(BoofuzzError): pass class BoofuzzTargetConnectionFailedError(BoofuzzError): pass class BoofuzzTargetConnectionReset(BoofuzzError): pass @attr.s class Boo...
import attr # Sulley EXception Class class BoofuzzError(Exception): pass class BoofuzzRestartFailedError(BoofuzzError): pass class BoofuzzTargetConnectionFailedError(BoofuzzError): pass class BoofuzzTargetConnectionReset(BoofuzzError): pass @attr.s class BoofuzzTargetConnectionAborted(BoofuzzE...
en
0.573579
# Sulley EXception Class Raised on `errno.ECONNABORTED`.
2.369984
2
hackerrank/data-structures/stacks/simple-text-editor/simple-text-editor.py
EliahKagan/practice
0
6625074
#!/usr/bin/env python3 """ HackerRank - Simple Text Editor https://www.hackerrank.com/challenges/simple-text-editor naive approach, storing full snapshots """ class Editor: """ Text buffer supporting appending and truncation, with undo capability. """ __slots__ = ('_buffers',) def __init__(self...
#!/usr/bin/env python3 """ HackerRank - Simple Text Editor https://www.hackerrank.com/challenges/simple-text-editor naive approach, storing full snapshots """ class Editor: """ Text buffer supporting appending and truncation, with undo capability. """ __slots__ = ('_buffers',) def __init__(self...
en
0.772627
#!/usr/bin/env python3 HackerRank - Simple Text Editor https://www.hackerrank.com/challenges/simple-text-editor naive approach, storing full snapshots Text buffer supporting appending and truncation, with undo capability. Creates a new editor with an initially empty buffer. Saves a checkpoint and appends text to the bu...
3.659637
4
main/views/public/common/common_decorator.py
tiberiucorbu/av-website
0
6625075
from . import * def decorate_page_response_model(resp_model): decorate_navbar_model(resp_model) decorate_page_meta(resp_model) decorate_view_reduced_switcher(resp_model) decorate_footer_model(resp_model)
from . import * def decorate_page_response_model(resp_model): decorate_navbar_model(resp_model) decorate_page_meta(resp_model) decorate_view_reduced_switcher(resp_model) decorate_footer_model(resp_model)
none
1
1.192042
1
sfepy/linalg/extmods/setup.py
vondrejc/sfepy
0
6625076
<gh_stars>0 #!/usr/bin/env python def configuration(parent_package='', top_path=None): import os.path as op from numpy.distutils.misc_util import Configuration from sfepy import Config site_config = Config() os_flag = {'posix' : 0, 'windows' : 1} auto_dir = op.dirname(__file__) auto_name...
#!/usr/bin/env python def configuration(parent_package='', top_path=None): import os.path as op from numpy.distutils.misc_util import Configuration from sfepy import Config site_config = Config() os_flag = {'posix' : 0, 'windows' : 1} auto_dir = op.dirname(__file__) auto_name = op.split(...
ru
0.26433
#!/usr/bin/env python
1.858936
2
ch6/decomposable_att_model/decomp_att.py
thundercrawl/book-of-qna-code
121
6625077
# -*- encoding:utf8 -*- import tensorflow as tf import numpy as np import os import sys from copy import deepcopy stdout = sys.stdout reload(sys) sys.stdout = stdout os.environ["CUDA_VISIBLE_DEVICES"] = "0" import cPickle as pkl from utils import * from models import DecompAtt class DecompAttConfig(object): def...
# -*- encoding:utf8 -*- import tensorflow as tf import numpy as np import os import sys from copy import deepcopy stdout = sys.stdout reload(sys) sys.stdout = stdout os.environ["CUDA_VISIBLE_DEVICES"] = "0" import cPickle as pkl from utils import * from models import DecompAtt class DecompAttConfig(object): def...
en
0.353128
# -*- encoding:utf8 -*- # 输入问题(句子)长度 # 输入答案长度 # 循环数 # batch大小 # 词表大小 # 词向量大小 # RNN单元类型和大小与堆叠层数 # 隐层大小 # keep_prob=1-dropout # 学习率 # print(batch_qids[0], [id2word[_] for _ in batch_q[0]], # batch_aids[0], [id2word[_] for _ in batch_ap[0]]) # print('Eval loss:{}'.format(total_loss / count))
1.970018
2
bids/layout/layout.py
miykael/pybids
1
6625078
import os import re import json import warnings from io import open from .validation import BIDSValidator from .. import config as cf from grabbit import Layout, File from grabbit.external import six, inflect from grabbit.utils import listify from collections import defaultdict from functools import reduce, partial fro...
import os import re import json import warnings from io import open from .validation import BIDSValidator from .. import config as cf from grabbit import Layout, File from grabbit.external import six, inflect from grabbit.utils import listify from collections import defaultdict from functools import reduce, partial fro...
en
0.773844
Add to the pool of available configuration files for BIDSLayout. Args: kwargs: each kwarg should be a pair of config key name, and path Example: bids.layout.add_config_paths(my_config='/path/to/config') Represents a single BIDS file. # Ensures backwards compatibility with old File_ namedtuple, which is...
2.101585
2
PastaPhase/energy_and_pressure.py
ppgaluzio/PastaPhase
0
6625079
# -*- coding: utf-8 -*- import numpy as np from scipy.integrate import quad def _int_e(k, m, gs, sigma): return np.sqrt(k**2 + (m - gs * sigma)**2) * k**2 def _int_p(k, m, gs, sigma): return k**4 / np.sqrt(k**2 + (m - gs * sigma)**2) def pressure(ms, mRho, rho, sigma, mw, w0, k, gs, m): """ press...
# -*- coding: utf-8 -*- import numpy as np from scipy.integrate import quad def _int_e(k, m, gs, sigma): return np.sqrt(k**2 + (m - gs * sigma)**2) * k**2 def _int_p(k, m, gs, sigma): return k**4 / np.sqrt(k**2 + (m - gs * sigma)**2) def pressure(ms, mRho, rho, sigma, mw, w0, k, gs, m): """ press...
en
0.472951
# -*- coding: utf-8 -*- pressure -------- calculate pressurey, eq. 4.160 from compact stars book parameters: ms: m_sigma sigma: scalar field mw: m_omega w0: omega_0 k: fermi energy gs: g_sigma m: mass energy ------ calculate energy density, eq. 4.160 from compact star...
3.153405
3
lib/JumpScale/baselib/mercurial/HgLibFactory.py
rudecs/jumpscale_core7
1
6625080
<gh_stars>1-10 from HgLibClient import HgLibClient from JumpScale import j class HgLibFactory: def __init__(self): j.logger.consolelogCategories.append("bitbucket") def getClient(self, hgbasedir, remoteUrl="", branchname=None, cleandir=False): """ return a mercurial tool which you can...
from HgLibClient import HgLibClient from JumpScale import j class HgLibFactory: def __init__(self): j.logger.consolelogCategories.append("bitbucket") def getClient(self, hgbasedir, remoteUrl="", branchname=None, cleandir=False): """ return a mercurial tool which you can help to manipu...
en
0.711372
return a mercurial tool which you can help to manipulate a hg repository @param base dir where local hgrepository will be stored @branchname "" means is the tip, None means will try to fetch the branchname from the basedir @param remote url of hg repository, e.g. https://login:passwd@bitbucket.o...
2.655421
3
cairis/test/test_PersonaCharacteristicAPI.py
RAIJ95/https-github.com-failys-cairis
0
6625081
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may...
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may...
en
0.865663
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may...
1.779565
2
app.py
AlJohri/cjmls
0
6625082
#!/usr/bin/env python3 import requests from flask import Flask, jsonify app = Flask(__name__) @app.route("/") def hello(): return "CJMLS" @app.route("/properties/<int:mlsid>") def get_property(mlsid): data = requests.get(f"https://queryserviceb.placester.net/search?sort_field=price&sort_direction=desc&searc...
#!/usr/bin/env python3 import requests from flask import Flask, jsonify app = Flask(__name__) @app.route("/") def hello(): return "CJMLS" @app.route("/properties/<int:mlsid>") def get_property(mlsid): data = requests.get(f"https://queryserviceb.placester.net/search?sort_field=price&sort_direction=desc&searc...
en
0.329903
#!/usr/bin/env python3 # mongo_id = data['organic_results']['search_results'][0]['mongo_id'] # url = f"https://www.mcmls.net/property/x/x/x/x/x/{mongo_id}/" # return f'<meta http-equiv="refresh" content="0; url={url}" />'
2.703481
3
nnpy/functions/cost_functions.py
AlexBacho/nnpy
0
6625083
<reponame>AlexBacho/nnpy import numpy as np def mse(actual, predicted): """ https://ml-cheatsheet.readthedocs.io/en/latest/linear_regression.html#cost-function MSE = the mean of (actual_outcome - predicted_outcome) squared """ return np.mean(np.power(actual - predicted, 2)) def prime_mse(actual,...
import numpy as np def mse(actual, predicted): """ https://ml-cheatsheet.readthedocs.io/en/latest/linear_regression.html#cost-function MSE = the mean of (actual_outcome - predicted_outcome) squared """ return np.mean(np.power(actual - predicted, 2)) def prime_mse(actual, predicted): """ ...
en
0.835593
https://ml-cheatsheet.readthedocs.io/en/latest/linear_regression.html#cost-function MSE = the mean of (actual_outcome - predicted_outcome) squared Derivate of mse for use with the Gradient Descent optimizer. Output error is calculated either as the result of the derivative of the cost function or as the res...
3.713768
4
core/python/kungfu/yijinjing/nanomsg.py
yunnant/kungfu
2,209
6625084
NS_NAMESPACE = 0 NS_VERSION = 1 NS_DOMAIN = 2 NS_TRANSPORT = 3 NS_PROTOCOL = 4 NS_OPTION_LEVEL = 5 NS_SOCKET_OPTION = 6 NS_TRANSPORT_OPTION = 7 NS_OPTION_TYPE = 8 NS_OPTION_UNIT = 9 NS_FLAG = 10 NS_ERROR = 11 NS_LIMIT = 12 NS_EVENT = 13 NS_STATISTIC = 14 TYPE_NONE = 0 TYPE_INT = 1 TYPE_STR = 2 UNIT_NONE = 0 UNIT_BYTES ...
NS_NAMESPACE = 0 NS_VERSION = 1 NS_DOMAIN = 2 NS_TRANSPORT = 3 NS_PROTOCOL = 4 NS_OPTION_LEVEL = 5 NS_SOCKET_OPTION = 6 NS_TRANSPORT_OPTION = 7 NS_OPTION_TYPE = 8 NS_OPTION_UNIT = 9 NS_FLAG = 10 NS_ERROR = 11 NS_LIMIT = 12 NS_EVENT = 13 NS_STATISTIC = 14 TYPE_NONE = 0 TYPE_INT = 1 TYPE_STR = 2 UNIT_NONE = 0 UNIT_BYTES ...
none
1
1.153924
1
tests/utils_tests/mask_tests/test_mask_to_bbox.py
souravsingh/chainercv
1,600
6625085
from __future__ import division import unittest import numpy as np from chainer.backends import cuda from chainer import testing from chainer.testing import attr from chainercv.utils import mask_to_bbox @testing.parameterize( {'mask': np.array( [[[False, False, False, False], [False, True, T...
from __future__ import division import unittest import numpy as np from chainer.backends import cuda from chainer import testing from chainer.testing import attr from chainercv.utils import mask_to_bbox @testing.parameterize( {'mask': np.array( [[[False, False, False, False], [False, True, T...
none
1
2.186669
2
integration/workflow/bigquery.py
pingsutw/flyte-app
7
6625086
<reponame>pingsutw/flyte-app<gh_stars>1-10 import pandas as pd from flytekit import task, StructuredDataset import os os.environ["GOOGLE_CLOUD_PROJECT"] = "flyte-test-340607" @task def my_task() -> StructuredDataset: df = pd.DataFrame({"Name": ["Tom", "Joseph"], "Age": [20, 22]}) return StructuredDataset(data...
import pandas as pd from flytekit import task, StructuredDataset import os os.environ["GOOGLE_CLOUD_PROJECT"] = "flyte-test-340607" @task def my_task() -> StructuredDataset: df = pd.DataFrame({"Name": ["Tom", "Joseph"], "Age": [20, 22]}) return StructuredDataset(dataframe=df, uri='bq://flyte-test-340607.datas...
ru
0.212371
# print(sd.open(pd.DataFrame).all())
2.882097
3
w3id/oauth2/session_auth.py
justinas-vd/python3-w3id
0
6625087
# Copyright 2018 IBM Corp. 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 agr...
# Copyright 2018 IBM Corp. 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 agr...
en
0.823511
# Copyright 2018 IBM Corp. 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 agr...
2.702933
3
datasets/usps.py
guoyang328/pytorch-dann
1
6625088
"""Dataset setting and data loader for MNIST.""" import torch from torchvision import datasets, transforms import os def get_usps(dataset_root, batch_size, train): """Get USPS datasets loader.""" # image pre-processing pre_process = transforms.Compose([transforms.Resize(28), ...
"""Dataset setting and data loader for MNIST.""" import torch from torchvision import datasets, transforms import os def get_usps(dataset_root, batch_size, train): """Get USPS datasets loader.""" # image pre-processing pre_process = transforms.Compose([transforms.Resize(28), ...
en
0.674192
Dataset setting and data loader for MNIST. Get USPS datasets loader. # image pre-processing # Mean for USPS train data # std for USPS train data # datasets and data loader
2.820618
3
missioncontrol/v0/groundstations.py
Psykar/missioncontrol
0
6625089
from home.models import GroundStation def search(limit=100): return [gs.to_dict() for gs in GroundStation.objects.all().order_by('hwid')[:limit]] def get_hwid(hwid): return GroundStation.objects.get(hwid=hwid).to_dict() def sanitize(groundstation): # XXX move to custom field on model i...
from home.models import GroundStation def search(limit=100): return [gs.to_dict() for gs in GroundStation.objects.all().order_by('hwid')[:limit]] def get_hwid(hwid): return GroundStation.objects.get(hwid=hwid).to_dict() def sanitize(groundstation): # XXX move to custom field on model i...
en
0.600746
# XXX move to custom field on model
2.466944
2
app/decorators/__init__.py
spetrovic450/ksvotes.org
10
6625090
<filename>app/decorators/__init__.py<gh_stars>1-10 from .insession import InSession
<filename>app/decorators/__init__.py<gh_stars>1-10 from .insession import InSession
none
1
1.238787
1
lib/rel_model.py
bknyaz/s
65
6625091
""" Base class for relationship models """ import torch.nn as nn import torch.nn.parallel import torchvision import copy from lib.get_union_boxes import UnionBoxesAndFeats from lib.pytorch_misc import diagonal_inds, bbox_overlaps, gather_res from lib.sparse_targets import FrequencyBias from config import * from torch...
""" Base class for relationship models """ import torch.nn as nn import torch.nn.parallel import torchvision import copy from lib.get_union_boxes import UnionBoxesAndFeats from lib.pytorch_misc import diagonal_inds, bbox_overlaps, gather_res from lib.sparse_targets import FrequencyBias from config import * from torch...
en
0.773978
Base class for relationship models RELATIONSHIPS :param mode: (sgcls, predcls, or sgdet) :param num_gpus: how many GPUS 2 use :param require_overlap_det: Whether two objects must intersect # See https://pytorch.org/tutorials/intermediate/torchvision_tutorial.html # replace the pre-trained head with a ne...
2.4205
2
ShortestPathGraphProject/venv/Lib/site-packages/networkx/algorithms/community/quality.py
NathanAllerton/ShortestPathGraph
445
6625092
<filename>ShortestPathGraphProject/venv/Lib/site-packages/networkx/algorithms/community/quality.py # quality.py - functions for measuring partitions of a graph # # Copyright 2015-2019 NetworkX developers. # # This file is part of NetworkX. # # NetworkX is distributed under a BSD license; see LICENSE.txt for more # info...
<filename>ShortestPathGraphProject/venv/Lib/site-packages/networkx/algorithms/community/quality.py # quality.py - functions for measuring partitions of a graph # # Copyright 2015-2019 NetworkX developers. # # This file is part of NetworkX. # # NetworkX is distributed under a BSD license; see LICENSE.txt for more # info...
en
0.826519
# quality.py - functions for measuring partitions of a graph # # Copyright 2015-2019 NetworkX developers. # # This file is part of NetworkX. # # NetworkX is distributed under a BSD license; see LICENSE.txt for more # information. Functions for measuring the quality of a partition (into communities). Raised if a given c...
2.694675
3
scripts/update_now.py
DS1SQM/OPKR081R3_201230
0
6625093
#!/usr/bin/env python3 import datetime from common.params import Params from selfdrive.data_collection import gps_uploader print("Don't forget to pray!") params = Params() t = datetime.datetime.utcnow().isoformat() params.put("LastUpdateTime", t.encode('utf8')) if params.get("IsOffroad") == b"1": print("Please wai...
#!/usr/bin/env python3 import datetime from common.params import Params from selfdrive.data_collection import gps_uploader print("Don't forget to pray!") params = Params() t = datetime.datetime.utcnow().isoformat() params.put("LastUpdateTime", t.encode('utf8')) if params.get("IsOffroad") == b"1": print("Please wai...
fr
0.221828
#!/usr/bin/env python3
2.907248
3
bleach/sanitizer.py
bope/bleach
0
6625094
from __future__ import unicode_literals from itertools import chain import re import six from six.moves.urllib.parse import urlparse from xml.sax.saxutils import unescape from bleach import html5lib_shim from bleach.utils import alphabetize_attributes, force_unicode #: List of allowed tags ALLOWED_TAGS = [ 'a'...
from __future__ import unicode_literals from itertools import chain import re import six from six.moves.urllib.parse import urlparse from xml.sax.saxutils import unescape from bleach import html5lib_shim from bleach.utils import alphabetize_attributes, force_unicode #: List of allowed tags ALLOWED_TAGS = [ 'a'...
en
0.7954
#: List of allowed tags #: Map of allowed attributes by tag #: List of allowed styles #: List of allowed protocols #: Invisible characters--0 to and including 31 except 9 (tab), 10 (lf), and 13 (cr) #: Regexp for characters that are invisible #: String to replace invisible characters with. This can be a character, a #:...
2.309547
2
channel.py
hashplex/Lightning
48
6625095
<gh_stars>10-100 """Micropayment channel API for a lightning node. Interface: API -- the Blueprint returned by serverutil.api_factory CHANNEL_OPENED -- a blinker signal sent when a channel is opened. Arguments: - address -- the url of the counterparty init(conf) - Set up the database create(url, mymoney, theirmoney)...
"""Micropayment channel API for a lightning node. Interface: API -- the Blueprint returned by serverutil.api_factory CHANNEL_OPENED -- a blinker signal sent when a channel is opened. Arguments: - address -- the url of the counterparty init(conf) - Set up the database create(url, mymoney, theirmoney) - Open a channel...
en
0.882588
Micropayment channel API for a lightning node. Interface: API -- the Blueprint returned by serverutil.api_factory CHANNEL_OPENED -- a blinker signal sent when a channel is opened. Arguments: - address -- the url of the counterparty init(conf) - Set up the database create(url, mymoney, theirmoney) - Open a channel wi...
2.482913
2
src/ssh/azext_ssh/connectivity_utils.py
haroonf/azure-cli-extensions
0
6625096
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
en
0.744954
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
1.83695
2
benchmarks/01-LE10-Thick-Plate/python_postprocessing/calculix_automate.py
dantelimac/CoFEA
0
6625097
<gh_stars>0 import numpy as np import subprocess import glob as gb import shutil import time import os import logging import ccx2paraview # Function changing input mesh inside the model.inp file def change_model_inp (input_file, change_mesh): # Input mesh path mesh_path = "*INCLUDE, INPUT="+ change_mesh +...
import numpy as np import subprocess import glob as gb import shutil import time import os import logging import ccx2paraview # Function changing input mesh inside the model.inp file def change_model_inp (input_file, change_mesh): # Input mesh path mesh_path = "*INCLUDE, INPUT="+ change_mesh + "\n" #...
en
0.694996
# Function changing input mesh inside the model.inp file # Input mesh path # Pressure load path # Read model.inp # Read all the lines of model.inp # Function which starts ccx solver and copy results # Run the CalculiX solver with ccx_2.17_MT commnad #Variables for copying/saving files #convert .frd to .vtu # Copy the r...
2.202986
2
pygsti/tools/jamiolkowski.py
drewrisinger/pyGSTi
1
6625098
<filename>pygsti/tools/jamiolkowski.py<gh_stars>1-10 """Utility functions related to the Choi representation of gates.""" #*************************************************************************************************** # Copyright 2015, 2019 National Technology & Engineering Solutions of Sandia, LLC (NTESS). # Unde...
<filename>pygsti/tools/jamiolkowski.py<gh_stars>1-10 """Utility functions related to the Choi representation of gates.""" #*************************************************************************************************** # Copyright 2015, 2019 National Technology & Engineering Solutions of Sandia, LLC (NTESS). # Unde...
en
0.742288
Utility functions related to the Choi representation of gates. #*************************************************************************************************** # Copyright 2015, 2019 National Technology & Engineering Solutions of Sandia, LLC (NTESS). # Under the terms of Contract DE-NA0003525 with NTESS, the U.S. G...
2.022131
2
src/z3c/testsetup/tests/cave/samplesetup_short3.py
zopefoundation/z3c.testsetup
1
6625099
import z3c.testsetup from z3c.testsetup.tests import cave test_suite = z3c.testsetup.register_pytests(cave)
import z3c.testsetup from z3c.testsetup.tests import cave test_suite = z3c.testsetup.register_pytests(cave)
none
1
1.065164
1
backend/reqlock/models/ogranisation_role.py
ChaikaBogdan/reqlock
1
6625100
from django.db import models from .organisation import Organisation from .model_mixins import SoftDeleteModel class OrganisationRole(SoftDeleteModel): code = models.CharField(max_length=255) name = models.CharField(max_length=255) organisation = models.ForeignKey(Organisation, on_delete=models.CASCADE) ...
from django.db import models from .organisation import Organisation from .model_mixins import SoftDeleteModel class OrganisationRole(SoftDeleteModel): code = models.CharField(max_length=255) name = models.CharField(max_length=255) organisation = models.ForeignKey(Organisation, on_delete=models.CASCADE) ...
none
1
2.119909
2
dashboard/dashboard/find_anomalies_test.py
blezek/catapult
0
6625101
<gh_stars>0 # Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import sys import unittest import mock from dashboard import find_anomalies from dashboard import find_change_points from dashboard.common impo...
# Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import sys import unittest import mock from dashboard import find_anomalies from dashboard import find_change_points from dashboard.common import testing_c...
en
0.891171
# Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # Sample time series. Makes a sample find_change_points.ChangePoint for use in these tests. # The only thing that matters in these tests is the revision numbe...
1.892878
2
tests/conftest.py
uktrade/directory-ch-client
0
6625102
def pytest_configure(): from django.conf import settings settings.configure( URLS_EXCLUDED_FROM_SIGNATURE_CHECK=[], DIRECTORY_CH_SEARCH_CLIENT_BASE_URL='https://chsearch.com', DIRECTORY_CH_SEARCH_CLIENT_API_KEY='test-api-key', DIRECTORY_CH_SEARCH_CLIENT_SENDER_ID='test-sender', ...
def pytest_configure(): from django.conf import settings settings.configure( URLS_EXCLUDED_FROM_SIGNATURE_CHECK=[], DIRECTORY_CH_SEARCH_CLIENT_BASE_URL='https://chsearch.com', DIRECTORY_CH_SEARCH_CLIENT_API_KEY='test-api-key', DIRECTORY_CH_SEARCH_CLIENT_SENDER_ID='test-sender', ...
none
1
1.518798
2
alembic/versions/2a68ba66c32b_add_active_translation_users.py
go-lab/appcomposer
1
6625103
<reponame>go-lab/appcomposer """Add Active translation users Revision ID: <KEY> Revises: <KEY> Create Date: 2015-04-27 13:32:26.521250 """ # revision identifiers, used by Alembic. revision = '<KEY>' down_revision = '<KEY>' from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto generat...
"""Add Active translation users Revision ID: <KEY> Revises: <KEY> Create Date: 2015-04-27 13:32:26.521250 """ # revision identifiers, used by Alembic. revision = '<KEY>' down_revision = '<KEY>' from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto generated by Alembic - please adjust...
en
0.513171
Add Active translation users Revision ID: <KEY> Revises: <KEY> Create Date: 2015-04-27 13:32:26.521250 # revision identifiers, used by Alembic. ### commands auto generated by Alembic - please adjust! ### ### end Alembic commands ### ### commands auto generated by Alembic - please adjust! ### ### end Alembic commands #...
1.372053
1
main/pre.py
noil-lion/licencePlateRecognition
0
6625104
<filename>main/pre.py import cv2 import numpy as np def img_preprocess(img): print("这是预处理") height = img.shape[0] width = img.shape[1] img = cv2.GaussianBlur(img, (3, 3), 0) # 高斯模糊去噪点 gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) ret, thresh = cv2.threshold(gray, 127, 255, cv2.THRESH_BINARY) ...
<filename>main/pre.py import cv2 import numpy as np def img_preprocess(img): print("这是预处理") height = img.shape[0] width = img.shape[1] img = cv2.GaussianBlur(img, (3, 3), 0) # 高斯模糊去噪点 gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) ret, thresh = cv2.threshold(gray, 127, 255, cv2.THRESH_BINARY) ...
zh
0.512055
# 高斯模糊去噪点 # 垂直边缘检测sobel算子
3.078723
3
titan/react_state_pkg/behavior/resources.py
mnieber/gen
0
6625105
<filename>titan/react_state_pkg/behavior/resources.py from dataclasses import dataclass from moonleap import Resource from moonleap.utils.inflect import plural @dataclass class Behavior(Resource): name: str item_name: str @property def items_name(self): return plural(self.item_name)
<filename>titan/react_state_pkg/behavior/resources.py from dataclasses import dataclass from moonleap import Resource from moonleap.utils.inflect import plural @dataclass class Behavior(Resource): name: str item_name: str @property def items_name(self): return plural(self.item_name)
none
1
2.018085
2
tests/resources/gatling/gatling-fake.py
IamSaurabh1/taurus
1,743
6625106
<reponame>IamSaurabh1/taurus import os import sys import platform print("Fake gatling output") print("dir:") print(os.path.abspath(os.curdir)) if len(sys.argv) == 2 and sys.argv[1] == '--help': exit(0) java_opts = os.environ.get("JAVA_OPTS", "").strip() + " " res_dir_opt = "gatling.core.directory.resources" sta...
import os import sys import platform print("Fake gatling output") print("dir:") print(os.path.abspath(os.curdir)) if len(sys.argv) == 2 and sys.argv[1] == '--help': exit(0) java_opts = os.environ.get("JAVA_OPTS", "").strip() + " " res_dir_opt = "gatling.core.directory.resources" start_res_dir = java_opts.find(r...
none
1
2.03057
2
app/core/safety/digest.py
zhongxinghong/EECS-Volunteer-Reservation-2-Backend
0
6625107
<filename>app/core/safety/digest.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- # filename: digest.py # modified: 2019-10-25 __all__ = [ "bMD5", "bSHA1", "bSHA256", "xMD5", "xSHA1", "xSHA256", "bHMAC_MD5", "bHMAC_SHA1", "bHMAC_SHA256", "xHMAC_MD5", "xHMAC_SHA1", "xHMAC_SHA256", ] import hash...
<filename>app/core/safety/digest.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- # filename: digest.py # modified: 2019-10-25 __all__ = [ "bMD5", "bSHA1", "bSHA256", "xMD5", "xSHA1", "xSHA256", "bHMAC_MD5", "bHMAC_SHA1", "bHMAC_SHA256", "xHMAC_MD5", "xHMAC_SHA1", "xHMAC_SHA256", ] import hash...
en
0.409658
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # filename: digest.py # modified: 2019-10-25
2.05219
2
redisolar/dao/redis/meter_reading.py
gbpereira1/ru102py
0
6625108
<reponame>gbpereira1/ru102py from redisolar.dao.base import MeterReadingDaoBase from redisolar.dao.redis.base import RedisDaoBase from redisolar.dao.redis.capacity_report import CapacityReportDaoRedis from redisolar.dao.redis.feed import FeedDaoRedis from redisolar.dao.redis.metric_timeseries import MetricDaoRedisTimes...
from redisolar.dao.base import MeterReadingDaoBase from redisolar.dao.redis.base import RedisDaoBase from redisolar.dao.redis.capacity_report import CapacityReportDaoRedis from redisolar.dao.redis.feed import FeedDaoRedis from redisolar.dao.redis.metric_timeseries import MetricDaoRedisTimeseries from redisolar.models i...
en
0.292206
# Uncomment for Challenge #3 # from redisolar.dao.redis.site_stats import SiteStatsDaoRedis MeterReadingDaoRedis persists MeterReading models to Redis. # Uncomment for Challenge #3 # SiteStatsDaoRedis(self.redis, self.key_schema).update(meter_reading, **kwargs)
1.963066
2
eventory/eventorial.py
siku2/Eventory
1
6625109
"""This module contains the Eventorial class and its utility functions. Attributes: URL_REGEX (Pattern): Regex used to check if a string is a url SANITISE_REGEX_STEPS (Tuple[Pattern]): Regex applied to a string in order to obtain a sanitised version of said string. """ import asyncio import logging import os ...
"""This module contains the Eventorial class and its utility functions. Attributes: URL_REGEX (Pattern): Regex used to check if a string is a url SANITISE_REGEX_STEPS (Tuple[Pattern]): Regex applied to a string in order to obtain a sanitised version of said string. """ import asyncio import logging import os ...
en
0.845184
This module contains the Eventorial class and its utility functions. Attributes: URL_REGEX (Pattern): Regex used to check if a string is a url SANITISE_REGEX_STEPS (Tuple[Pattern]): Regex applied to a string in order to obtain a sanitised version of said string. # remove unwanted chars # reduce space # trim en...
2.621054
3
wo/cli/plugins/info.py
BreezeRo/WordOps
1
6625110
<filename>wo/cli/plugins/info.py<gh_stars>1-10 """WOInfo Plugin for WordOps""" import configparser import os from cement.core import handler, hook from cement.core.controller import CementBaseController, expose from pynginxconfig import NginxConfig from wo.core.aptget import WOAptGet from wo.core.logging import Log ...
<filename>wo/cli/plugins/info.py<gh_stars>1-10 """WOInfo Plugin for WordOps""" import configparser import os from cement.core import handler, hook from cement.core.controller import CementBaseController, expose from pynginxconfig import NginxConfig from wo.core.aptget import WOAptGet from wo.core.logging import Log ...
en
0.386769
WOInfo Plugin for WordOps Display Nginx information Display PHP information Display PHP information Display MySQL information default function for info # register the plugin class.. this only happens if the plugin is enabled # register a hook (function) to run after arguments are parsed.
2.32701
2
sentinel/serializers/alarm_serializer.py
creditease-natrix/natrix
3
6625111
# -*- coding: utf-8 -*- from __future__ import unicode_literals import logging from rest_framework import serializers from natrix.common.natrix_views.serializers import NatrixSerializer from benchmark.models import Task from sentinel.configurations import alarm_conf from sentinel.models import Alarm from sentinel...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import logging from rest_framework import serializers from natrix.common.natrix_views.serializers import NatrixSerializer from benchmark.models import Task from sentinel.configurations import alarm_conf from sentinel.models import Alarm from sentinel...
en
0.694358
# -*- coding: utf-8 -*- # TODO: validate if this task is your owned task or followed task # TODO: validate aggregation configuration
1.86877
2
accounts/tokens.py
PudgyPoppins/AP-Crowd-2020
0
6625112
<gh_stars>0 from django.contrib.auth.tokens import PasswordResetTokenGenerator import uuid #from django.utils import six class TokenGenerator(PasswordResetTokenGenerator): def _make_hash_value(self, user, timestamp): return ( str(user.pk) + str(timestamp) + str(user.is_active) ) account_...
from django.contrib.auth.tokens import PasswordResetTokenGenerator import uuid #from django.utils import six class TokenGenerator(PasswordResetTokenGenerator): def _make_hash_value(self, user, timestamp): return ( str(user.pk) + str(timestamp) + str(user.is_active) ) account_activation_t...
en
0.187487
#from django.utils import six
2.291242
2
gprm/datasets/Seafloor.py
siwill22/GPlatesReconstructionModel
7
6625113
<reponame>siwill22/GPlatesReconstructionModel from pooch import os_cache as _os_cache from pooch import retrieve as _retrieve from pooch import HTTPDownloader as _HTTPDownloader from pooch import Untar as _Untar from pooch import Unzip as _Unzip import pandas as _pd import geopandas as _gpd import os as _os def Magne...
from pooch import os_cache as _os_cache from pooch import retrieve as _retrieve from pooch import HTTPDownloader as _HTTPDownloader from pooch import Untar as _Untar from pooch import Unzip as _Unzip import pandas as _pd import geopandas as _gpd import os as _os def MagneticPicks(load=True): ''' Magnetic Pick...
en
0.682297
Magnetic Picks from the 'Global Seafloor Fabric (and) Magnetic Linations' database, returned as a geopandas dataframe Alternatively, select 'load=False' to return filname of '.gmt' file in cache folder Seafloor fabric from the 'Global Seafloor Fabric (and) Magnetic Linations' database, returned as a g...
2.537485
3
rst2pdf/extensions/plantuml.py
oz123/rst2pdf
39
6625114
<gh_stars>10-100 ''' A rst2pdf extension to implement something similar to sphinx's plantuml extension (see http://pypi.python.org/pypi/sphinxcontrib-plantuml) Therefore, stuff may be copied from that code. Ergo: :copyright: Copyright 2010 by <NAME> <<EMAIL>>. :license: BSD, (he says see LICENSE but the file ...
''' A rst2pdf extension to implement something similar to sphinx's plantuml extension (see http://pypi.python.org/pypi/sphinxcontrib-plantuml) Therefore, stuff may be copied from that code. Ergo: :copyright: Copyright 2010 by <NAME> <<EMAIL>>. :license: BSD, (he says see LICENSE but the file is not there ;-) ...
en
0.811742
A rst2pdf extension to implement something similar to sphinx's plantuml extension (see http://pypi.python.org/pypi/sphinxcontrib-plantuml) Therefore, stuff may be copied from that code. Ergo: :copyright: Copyright 2010 by <NAME> <<EMAIL>>. :license: BSD, (he says see LICENSE but the file is not there ;-) Dire...
2.717124
3
OasisPy/montage.py
ahstewart/OASIS
0
6625115
<filename>OasisPy/montage.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Mar 13 18:40:54 2019 @author: andrew """ # Startup. The Montage modules are pretty much self-contained # but this script needs a few extra utilities. import os import sys import shutil import glob from astr...
<filename>OasisPy/montage.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Mar 13 18:40:54 2019 @author: andrew """ # Startup. The Montage modules are pretty much self-contained # but this script needs a few extra utilities. import os import sys import shutil import glob from astr...
en
0.849561
#!/usr/bin/env python3 # -*- coding: utf-8 -*- Created on Wed Mar 13 18:40:54 2019 @author: andrew # Startup. The Montage modules are pretty much self-contained # but this script needs a few extra utilities. Interfaces with MontagePy to build a mosaic from a set of input images. All parameters are supplied through ...
2.914061
3
shylock/core/celery/celery.py
ufcg-lsd/shylock
1
6625116
<reponame>ufcg-lsd/shylock import os from datetime import datetime from core.conf import conf_file from pytz import timezone from celery import Celery from celery.schedules import crontab os.environ.setdefault("DJANGO_SETTINGS_MODULE", "conf.settings") app = Celery("core") app.config_from_object("django.conf:settin...
import os from datetime import datetime from core.conf import conf_file from pytz import timezone from celery import Celery from celery.schedules import crontab os.environ.setdefault("DJANGO_SETTINGS_MODULE", "conf.settings") app = Celery("core") app.config_from_object("django.conf:settings", namespace="CELERY") ap...
en
0.587807
# Aggregate report crontab # cinder # keystone # nova # monasca # core reports
2.078143
2
Lectures/observed_energy_budget.py
EasezzZ/Climate_Modeling_Lect
136
6625117
<gh_stars>100-1000 ''' This module sets values for the observed global mean planetary energy budget Based on values reported in Trenberth and Fasullo (2012) Surv. Geophys. All values in units of W/m2 Four dictionaries are defined: - SW (the shortwave radiation budget) - LW (the longwave radiation budget) - Turbulent ...
''' This module sets values for the observed global mean planetary energy budget Based on values reported in Trenberth and Fasullo (2012) Surv. Geophys. All values in units of W/m2 Four dictionaries are defined: - SW (the shortwave radiation budget) - LW (the longwave radiation budget) - Turbulent (surface turbulent ...
en
0.759481
This module sets values for the observed global mean planetary energy budget Based on values reported in Trenberth and Fasullo (2012) Surv. Geophys. All values in units of W/m2 Four dictionaries are defined: - SW (the shortwave radiation budget) - LW (the longwave radiation budget) - Turbulent (surface turbulent flux...
2.273482
2
gpu_utils.py
ZmeiGorynych/basic_pytorch
2
6625118
use_gpu=True if use_gpu: from torch.cuda import FloatTensor, LongTensor, ByteTensor def to_gpu(x): return x.cuda() else: from torch import FloatTensor, LongTensor, ByteTensor def to_gpu(x): return x.cpu() x1 = FloatTensor() x2 = ByteTensor() # the below function is from the Pytorch foru...
use_gpu=True if use_gpu: from torch.cuda import FloatTensor, LongTensor, ByteTensor def to_gpu(x): return x.cuda() else: from torch import FloatTensor, LongTensor, ByteTensor def to_gpu(x): return x.cpu() x1 = FloatTensor() x2 = ByteTensor() # the below function is from the Pytorch foru...
en
0.809254
# the below function is from the Pytorch forums # https://discuss.pytorch.org/t/access-gpu-memory-usage-in-pytorch/3192/3 Get the current gpu usage. Returns ------- usage: dict Keys are device ids as integers. Values are memory usage as integers in MB. # Convert lines into a dictionary
3.07768
3
gazoo_device/tests/unit_tests/utils/unifi_poe_switch_device_logs.py
dedsec-9/gazoo-device
14
6625119
<filename>gazoo_device/tests/unit_tests/utils/unifi_poe_switch_device_logs.py # Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licens...
<filename>gazoo_device/tests/unit_tests/utils/unifi_poe_switch_device_logs.py # Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licens...
en
0.467305
# Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
1.991622
2
app/view/__init__.py
LuckyQueen0928/tanna
3
6625120
<gh_stars>1-10 # -*- coding: utf-8 -*- from flask import Blueprint view = Blueprint('view', __name__) from . import views
# -*- coding: utf-8 -*- from flask import Blueprint view = Blueprint('view', __name__) from . import views
en
0.769321
# -*- coding: utf-8 -*-
1.209938
1
fgapiservergui_config.py
FutureGatewayFramework/fgAPIServerGUI
0
6625121
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2015: # Istituto Nazionale di Fisica Nucleare (INFN), Italy # # See http://www.infn.it for details on the copyrigh holder # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2015: # Istituto Nazionale di Fisica Nucleare (INFN), Italy # # See http://www.infn.it for details on the copyrigh holder # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. ...
en
0.707997
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2015: # Istituto Nazionale di Fisica Nucleare (INFN), Italy # # See http://www.infn.it for details on the copyrigh holder # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. ...
1.837953
2
data/video_dataset.py
MikeWangWZHL/BLIP
473
6625122
<reponame>MikeWangWZHL/BLIP from torch.utils.data import Dataset from torchvision.datasets.utils import download_url from PIL import Image import torch import numpy as np import random import decord from decord import VideoReader import json import os from data.utils import pre_caption decord.bridge.set_bridge("torch...
from torch.utils.data import Dataset from torchvision.datasets.utils import download_url from PIL import Image import torch import numpy as np import random import decord from decord import VideoReader import json import os from data.utils import pre_caption decord.bridge.set_bridge("torch") class ImageNorm(object):...
en
0.691833
Apply Normalization to Image Pixels on GPU image_root (string): Root directory of video ann_root (string): directory to store the annotation file
2.4863
2
ironic/api/controllers/v1/volume_connector.py
inmotionhosting/ironic
1
6625123
# Copyright (c) 2017 Hitachi, Ltd. # # 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 ...
# Copyright (c) 2017 Hitachi, Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
en
0.749382
# Copyright (c) 2017 Hitachi, Ltd. # # 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 ...
1.70926
2
examples/frompapers/Rothman_Manis_2003.py
awillats/brian2
674
6625124
#!/usr/bin/env python """ Cochlear neuron model of Rothman & Manis ---------------------------------------- <NAME>, <NAME> (2003) The roles potassium currents play in regulating the electrical activity of ventral cochlear nucleus neurons. J Neurophysiol 89:3097-113. All model types differ only by the maximal conductan...
#!/usr/bin/env python """ Cochlear neuron model of Rothman & Manis ---------------------------------------- <NAME>, <NAME> (2003) The roles potassium currents play in regulating the electrical activity of ventral cochlear nucleus neurons. J Neurophysiol 89:3097-113. All model types differ only by the maximal conductan...
en
0.26286
#!/usr/bin/env python Cochlear neuron model of Rothman & Manis ---------------------------------------- <NAME>, <NAME> (2003) The roles potassium currents play in regulating the electrical activity of ventral cochlear nucleus neurons. J Neurophysiol 89:3097-113. All model types differ only by the maximal conductances....
2.783093
3
cinder/image/accelerator.py
cloudification-io/cinder
8
6625125
<reponame>cloudification-io/cinder # # 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 ...
# # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # ...
en
0.876763
# # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # ...
2.008881
2
src/kmeans_all/kmeans_training.py
tapojyotipaul/xgboost-benchmarks
0
6625126
<reponame>tapojyotipaul/xgboost-benchmarks from timeit import default_timer as timer import xgboost as xgb from sklearn.metrics import mean_squared_error import daal4py as d4p import numpy as np import pandas as pd from sklearn.cluster import KMeans import common kmeans_kwargs = { "init": "random", "n_init": 10...
from timeit import default_timer as timer import xgboost as xgb from sklearn.metrics import mean_squared_error import daal4py as d4p import numpy as np import pandas as pd from sklearn.cluster import KMeans import common kmeans_kwargs = { "init": "random", "n_init": 10, "max_iter": 100, "random_state": 42...
de
0.182904
Run xgboost for specified number of observations # Load data ######################
2.923475
3
MOCVRP/POMO/MOCVRPEnv.py
Xi-L/PMOCO
0
6625127
from dataclasses import dataclass import torch from MOCVRProblemDef import get_random_problems, augment_xy_data_by_8_fold @dataclass class Reset_State: depot_xy: torch.Tensor = None node_xy: torch.Tensor = None node_demand: torch.Tensor = None # shape: (batch, problem) @dataclas...
from dataclasses import dataclass import torch from MOCVRProblemDef import get_random_problems, augment_xy_data_by_8_fold @dataclass class Reset_State: depot_xy: torch.Tensor = None node_xy: torch.Tensor = None node_demand: torch.Tensor = None # shape: (batch, problem) @dataclas...
en
0.534456
# shape: (batch, problem) # shape: (batch, pomo) # shape: (batch, pomo) # shape: (batch, pomo, problem+1) # shape: (batch, pomo) # Const @INIT #################################### # Const @Load_Problem #################################### # IDX.shape: (batch, pomo) # shape: (batch, problem+1, 2) # shape: (batch, proble...
2.258219
2
python/tvm/script/tir/ty.py
BaldLee/tvm
10
6625128
<filename>python/tvm/script/tir/ty.py # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Versio...
<filename>python/tvm/script/tir/ty.py # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Versio...
en
0.76743
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
1.799069
2
shop/models.py
Zex0n/django-simple-cms
1
6625129
from django.db import models from django.utils.translation import ugettext_lazy as _, ugettext from mptt.models import MPTTModel, TreeForeignKey from taggit.managers import TaggableManager from urllib.parse import urljoin from django.core.urlresolvers import resolve, reverse from django.conf import settings from django...
from django.db import models from django.utils.translation import ugettext_lazy as _, ugettext from mptt.models import MPTTModel, TreeForeignKey from taggit.managers import TaggableManager from urllib.parse import urljoin from django.core.urlresolvers import resolve, reverse from django.conf import settings from django...
none
1
1.911547
2
napari/layers/shapes/_shapes_models/_polgyon_base.py
Zac-HD/napari
1
6625130
import numpy as np from .._shapes_utils import create_box from .shape import Shape class PolygonBase(Shape): """Class for a polygon or path. Parameters ---------- data : np.ndarray NxD array of vertices specifying the path. edge_width : float thickness of lines and edges. z_i...
import numpy as np from .._shapes_utils import create_box from .shape import Shape class PolygonBase(Shape): """Class for a polygon or path. Parameters ---------- data : np.ndarray NxD array of vertices specifying the path. edge_width : float thickness of lines and edges. z_i...
en
0.813905
Class for a polygon or path. Parameters ---------- data : np.ndarray NxD array of vertices specifying the path. edge_width : float thickness of lines and edges. z_index : int Specifier of z order priority. Shapes with higher z order are displayed ontop of others. ...
3.092027
3
zerver/views/auth.py
fatihCinarKrtg/zulip
1
6625131
<reponame>fatihCinarKrtg/zulip import logging import secrets import urllib from functools import wraps from typing import Any, Dict, List, Mapping, Optional, cast from urllib.parse import urlencode import jwt from cryptography.hazmat.primitives.ciphers.aead import AESGCM from django.conf import settings from django.co...
import logging import secrets import urllib from functools import wraps from typing import Any, Dict, List, Mapping, Optional, cast from urllib.parse import urlencode import jwt from cryptography.hazmat.primitives.ciphers.aead import AESGCM from django.conf import settings from django.contrib.auth import authenticate ...
en
0.872089
# Mark as safe to prevent Pysa from surfacing false positives for # open redirects. In this branch, we have already checked that the URL # points to the specified 'redirect_host', or is relative. Given a successful authentication for an email address (i.e. we've confirmed the user controls the email address) that d...
1.38864
1
Algorithms/CloudMasking/modis_surface_reflectance_qa_band.py
guy1ziv2/earthengine-py-notebooks
1
6625132
''' <table class="ee-notebook-buttons" align="left"> <td><a target="_blank" href="https://github.com/giswqs/earthengine-py-notebooks/tree/master/Algorithms/CloudMasking/modis_surface_reflectance_qa_band.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a>...
''' <table class="ee-notebook-buttons" align="left"> <td><a target="_blank" href="https://github.com/giswqs/earthengine-py-notebooks/tree/master/Algorithms/CloudMasking/modis_surface_reflectance_qa_band.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a>...
en
0.610567
<table class="ee-notebook-buttons" align="left"> <td><a target="_blank" href="https://github.com/giswqs/earthengine-py-notebooks/tree/master/Algorithms/CloudMasking/modis_surface_reflectance_qa_band.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a></td...
1.248627
1
emails/forms.py
LoveProgramming-Limited/Django-CRM-2
0
6625133
from django import forms from .models import Email class EmailForm(forms.ModelForm): from_email = forms.EmailField(max_length=200, required=True) to_email = forms.EmailField(max_length=200, required=True) subject = forms.CharField(max_length=200, required=True) message = forms.CharField(max_length=20...
from django import forms from .models import Email class EmailForm(forms.ModelForm): from_email = forms.EmailField(max_length=200, required=True) to_email = forms.EmailField(max_length=200, required=True) subject = forms.CharField(max_length=200, required=True) message = forms.CharField(max_length=20...
none
1
2.402851
2
test/testSimple.py
18280108415/Interface
0
6625134
<reponame>18280108415/Interface<gh_stars>0 import requests import json import unittest import re import readExcel import json import os path = os.path.dirname(os.getcwd())+"\\data\\C1.2testCase1.xls" testData = readExcel.ReadExcel.readExcel(path, "C12testCase") s = requests.session() class UCTestCase(unittest.TestCase...
import requests import json import unittest import re import readExcel import json import os path = os.path.dirname(os.getcwd())+"\\data\\C1.2testCase1.xls" testData = readExcel.ReadExcel.readExcel(path, "C12testCase") s = requests.session() class UCTestCase(unittest.TestCase): def test_send_request(self): ...
zh
0.498261
#返回的dict类型,str()将dict转换成str #type()查看数据类型 #re_json.dump() #print(re_json.dump()) #print(re.text) #正则提取里面的文字 # 通过正则表达式 r"<a.*?>.*?</a>" 找到所有的数据并输出 #self.assertEqual(200,res.status_code,"接口请求失败") #self.assertIn(self,words,re.text) # print(re.status_code)
2.867068
3
pushtokindle.py
ritiek/url-to-kindle
15
6625135
import requests import sys FROM = "<EMAIL>" TO = "<EMAIL>" email, domain_name = TO.split("@") available_domain_names = ("free.kindle.com", "kindle.com", "kindle.cn", "iduokan.com", "pbsync.com") domain_int = available_domain_names.index(domain_name) + 1 params = ( ("context", "send"), ("url", sys.argv[1]), )...
import requests import sys FROM = "<EMAIL>" TO = "<EMAIL>" email, domain_name = TO.split("@") available_domain_names = ("free.kindle.com", "kindle.com", "kindle.cn", "iduokan.com", "pbsync.com") domain_int = available_domain_names.index(domain_name) + 1 params = ( ("context", "send"), ("url", sys.argv[1]), )...
none
1
3.056622
3
tensorflow/python/framework/function.py
MathMachado/tensorflow
1
6625136
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
en
0.716719
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
1.894041
2
rplugin/python3/deoplete/filter/matcher_full_fuzzy.py
nholik/deoplete.nvim
0
6625137
# ============================================================================ # FILE: matcher_full_fuzzy.py # AUTHOR: <NAME> <Shougo.Matsu at gmail.com> # License: MIT license # ============================================================================ import re from deoplete.base.filter import Base from deoplete.u...
# ============================================================================ # FILE: matcher_full_fuzzy.py # AUTHOR: <NAME> <Shougo.Matsu at gmail.com> # License: MIT license # ============================================================================ import re from deoplete.base.filter import Base from deoplete.u...
en
0.332418
# ============================================================================ # FILE: matcher_full_fuzzy.py # AUTHOR: <NAME> <Shougo.Matsu at gmail.com> # License: MIT license # ============================================================================
2.468983
2
util/tfrecord.py
entn-at/yamagishilab_tacotron2
80
6625138
<reponame>entn-at/yamagishilab_tacotron2 # ============================================================================== # Copyright (c) 2018, Yamagishi Laboratory, National Institute of Informatics # Author: <NAME> (<EMAIL>) # All rights reserved. # ====================================================================...
# ============================================================================== # Copyright (c) 2018, Yamagishi Laboratory, National Institute of Informatics # Author: <NAME> (<EMAIL>) # All rights reserved. # ============================================================================== """ Reading and writing TFReco...
en
0.568486
# ============================================================================== # Copyright (c) 2018, Yamagishi Laboratory, National Institute of Informatics # Author: <NAME> (<EMAIL>) # All rights reserved. # ============================================================================== Reading and writing TFRecord f...
2.471753
2
synapse/federation/federation_client.py
chagai95/synapse
0
6625139
# Copyright 2015-2022 The Matrix.org Foundation C.I.C. # Copyright 2020 Sorunome # # 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 ...
# Copyright 2015-2022 The Matrix.org Foundation C.I.C. # Copyright 2020 Sorunome # # 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 ...
en
0.89646
# Copyright 2015-2022 The Matrix.org Foundation C.I.C. # Copyright 2020 Sorunome # # 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 ...
1.386191
1
parsec/commands/histories/get_most_recently_used_history.py
erasche/parsec
8
6625140
<gh_stars>1-10 import click from parsec.cli import pass_context, json_loads from parsec.decorators import custom_exception, json_output @click.command('get_most_recently_used_history') @pass_context @custom_exception @json_output def cli(ctx): """Returns the current user's most recently used history (not deleted)...
import click from parsec.cli import pass_context, json_loads from parsec.decorators import custom_exception, json_output @click.command('get_most_recently_used_history') @pass_context @custom_exception @json_output def cli(ctx): """Returns the current user's most recently used history (not deleted). Output: ...
en
0.792143
Returns the current user's most recently used history (not deleted). Output: History representation
2.074104
2
main.py
LiReNa00/JDBot
0
6625141
import os import logging import discord import re import aiohttp import traceback import asyncpg import B from discord.ext import commands async def get_prefix(bot, message): extras = ["test*", "te*", "t*", "jdbot.", "jd.", "test.", "te."] comp = re.compile("^(" + "|".join(map(re.escape, extras)) + ").*", fl...
import os import logging import discord import re import aiohttp import traceback import asyncpg import B from discord.ext import commands async def get_prefix(bot, message): extras = ["test*", "te*", "t*", "jdbot.", "jd.", "test.", "te."] comp = re.compile("^(" + "|".join(map(re.escape, extras)) + ").*", fl...
en
0.849408
# loads up some bot variables # does the DB connection and then assigns it a tester list # print(event) # print(more_information[0]) # print(args) # print(kwargs) # check about on_error with other repos of mine as well to update this.
2.291763
2
ci/nfbuildosx.py
dmyers87/NFHTTP
573
6625142
#!/usr/bin/env python ''' * Copyright (c) 2018 Spotify AB. * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you un...
#!/usr/bin/env python ''' * Copyright (c) 2018 Spotify AB. * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you un...
en
0.841708
#!/usr/bin/env python * Copyright (c) 2018 Spotify AB. * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under t...
1.845425
2
utils/train_utils.py
HickmannLautaro/GroupNorm
0
6625143
import argparse import os import shutil import sys import time import tensorflow as tf import tensorflow_datasets as tfds def get_parsed_in(): """ Parse command line inputs @return: arguments dictionary containing parsed command line inputs """ parser = argparse.ArgumentParser(description="Configu...
import argparse import os import shutil import sys import time import tensorflow as tf import tensorflow_datasets as tfds def get_parsed_in(): """ Parse command line inputs @return: arguments dictionary containing parsed command line inputs """ parser = argparse.ArgumentParser(description="Configu...
en
0.719954
Parse command line inputs @return: arguments dictionary containing parsed command line inputs Creates the folder structure needed to save logs and checkpoints depending on the @param arguments: run configuration @return: log_path where to save logs and models_path where to save the checkpoints. # If paths e...
2.681754
3
public/assets/client_installer/payload/usr/local/munkireport/munkilib/FoundationPlist.py
poundbangbash/munkireport-php-1
4
6625144
# encoding: utf-8 # # Copyright 2009-2019 <NAME>. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
# encoding: utf-8 # # Copyright 2009-2019 <NAME>. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
en
0.809702
# encoding: utf-8 # # Copyright 2009-2019 <NAME>. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
2.121429
2
pytype/tests/test_super.py
isabella232/pytype
0
6625145
<gh_stars>0 """Tests for super().""" from pytype import file_utils from pytype.tests import test_base class SuperTest(test_base.TargetIndependentTest): """Tests for super().""" def test_set_attr(self): self.Check(""" class Foo(object): def foo(self, name, value): super(Foo, self).__s...
"""Tests for super().""" from pytype import file_utils from pytype.tests import test_base class SuperTest(test_base.TargetIndependentTest): """Tests for super().""" def test_set_attr(self): self.Check(""" class Foo(object): def foo(self, name, value): super(Foo, self).__setattr__(nam...
en
0.532182
Tests for super(). Tests for super(). class Foo(object): def foo(self, name, value): super(Foo, self).__setattr__(name, value) class Foo(object): def foo(self, name, value): super(Foo, self).__str__() class Foo(object): def foo(self, name, value): super(Foo, self)._...
2.858027
3
homeassistant/components/mysensors/sensor.py
sebcaps/core
2
6625146
<filename>homeassistant/components/mysensors/sensor.py<gh_stars>1-10 """Support for MySensors sensors.""" from __future__ import annotations from awesomeversion import AwesomeVersion from homeassistant.components import mysensors from homeassistant.components.sensor import DOMAIN, SensorEntity from homeassistant.conf...
<filename>homeassistant/components/mysensors/sensor.py<gh_stars>1-10 """Support for MySensors sensors.""" from __future__ import annotations from awesomeversion import AwesomeVersion from homeassistant.components import mysensors from homeassistant.components.sensor import DOMAIN, SensorEntity from homeassistant.conf...
en
0.74691
Support for MySensors sensors. Set up this platform for a specific ConfigEntry(==Gateway). Discover and add a MySensors sensor. Representation of a MySensors Sensor child node. Return True if state updates should be forced. If True, a state change will be triggered anytime the state property is updated...
1.739944
2
wiki/web/util/database.py
WillStOnge/CSC-440-Project
0
6625147
from flask import current_app from .singleton import Singleton import pyodbc class Database(Singleton): def __init__(self): """ Initializes an instance of the Database with a connection to the database. """ self._conn = pyodbc.connect(current_app.config['CONNECTION_STRING']) d...
from flask import current_app from .singleton import Singleton import pyodbc class Database(Singleton): def __init__(self): """ Initializes an instance of the Database with a connection to the database. """ self._conn = pyodbc.connect(current_app.config['CONNECTION_STRING']) d...
en
0.82084
Initializes an instance of the Database with a connection to the database. Executes a query where a result is expected (SELECT statements). :param query: The query to be executed. :return: A dictionary of the results from the query. None if an error occured. Executes a query where no result is expecte...
2.959835
3
start.py
SINTEF-SE/PySSMic
0
6625148
from index import app import webbrowser webbrowser.open("127.0.0.1:8050") app.run_server()
from index import app import webbrowser webbrowser.open("127.0.0.1:8050") app.run_server()
none
1
1.935531
2
support/mesos-style.py
maselvaraj/mesos
0
6625149
<reponame>maselvaraj/mesos<gh_stars>0 #!/usr/bin/env python ''' Runs checks for mesos style. ''' import os import re import string import subprocess import sys # Root source paths (will be traversed recursively). source_dirs = ['src', 'include', os.path.join('3rdparty', 'libprocess')] ...
#!/usr/bin/env python ''' Runs checks for mesos style. ''' import os import re import string import subprocess import sys # Root source paths (will be traversed recursively). source_dirs = ['src', 'include', os.path.join('3rdparty', 'libprocess')] # Add file paths and patterns which sh...
en
0.853604
#!/usr/bin/env python Runs checks for mesos style. # Root source paths (will be traversed recursively). # Add file paths and patterns which should not be checked # This should include 3rdparty libraries, includes and machine generated # source. Runs cpplint over given files. http://google-styleguide.googlecode.com...
2.211801
2
src/rubrix/client/sdk/token_classification/api.py
davidkartchner/rubrix
1
6625150
<reponame>davidkartchner/rubrix # coding=utf-8 # Copyright 2021-present, the Recognai S.L. team. # # 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/L...
# coding=utf-8 # Copyright 2021-present, the Recognai S.L. team. # # 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 ...
en
0.854778
# coding=utf-8 # Copyright 2021-present, the Recognai S.L. team. # # 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 ...
1.820948
2