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 |
|---|---|---|---|---|---|---|---|---|---|---|
option_batch_trxn.py | shawlu95/td-ameritrade-python-api | 0 | 6631751 | # run at 1:01 pm every day
# 1 13 * * * /Users/shawlu/Documents/anaconda3/envs/analytics/bin/python3 /Users/shawlu/Documents/td-ameritrade-python-api/option_daily_trxn.py
import pandas as pd
from td.client import TDClient
from td.enums import ORDER_SESSION, ORDER_TYPE
from util.options import processOptionTrade, ordere... | # run at 1:01 pm every day
# 1 13 * * * /Users/shawlu/Documents/anaconda3/envs/analytics/bin/python3 /Users/shawlu/Documents/td-ameritrade-python-api/option_daily_trxn.py
import pandas as pd
from td.client import TDClient
from td.enums import ORDER_SESSION, ORDER_TYPE
from util.options import processOptionTrade, ordere... | en | 0.420944 | # run at 1:01 pm every day # 1 13 * * * /Users/shawlu/Documents/anaconda3/envs/analytics/bin/python3 /Users/shawlu/Documents/td-ameritrade-python-api/option_daily_trxn.py # create a new session # insert today's option trades into database | 2.240919 | 2 |
test/test_arnoldi.py | JohnReid/nolina | 0 | 6631752 | <gh_stars>0
from codetiming import Timer
import logging
import pytest
import numpy as np
from nolina import random, arnoldi
_logger = logging.getLogger(__name__)
js = [9, 10, 11]
@pytest.mark.parametrize("j", js)
def test_arnoldi(j, rng, seed):
d = 11
A = random.random_spsd_matrix(d=d, random_state=rng)
... | from codetiming import Timer
import logging
import pytest
import numpy as np
from nolina import random, arnoldi
_logger = logging.getLogger(__name__)
js = [9, 10, 11]
@pytest.mark.parametrize("j", js)
def test_arnoldi(j, rng, seed):
d = 11
A = random.random_spsd_matrix(d=d, random_state=rng)
b = random.r... | none | 1 | 2.136248 | 2 | |
roles/slurm/files/citc_gcp.py | danhnguyen48/slurm-elastic-computing | 0 | 6631753 | <filename>roles/slurm/files/citc_gcp.py
import re
import subprocess
import time
from typing import Dict, Optional, Tuple
from google.oauth2 import service_account # type: ignore
import googleapiclient.discovery # type: ignore
import logging
import yaml
import os
from pathlib import Path
import asyncio
__all__ = ["ge... | <filename>roles/slurm/files/citc_gcp.py
import re
import subprocess
import time
from typing import Dict, Optional, Tuple
from google.oauth2 import service_account # type: ignore
import googleapiclient.discovery # type: ignore
import logging
import yaml
import os
from pathlib import Path
import asyncio
__all__ = ["ge... | en | 0.825925 | # type: ignore # type: ignore Get the information about the space into which we were creating nodes This will be static for all nodes in this cluster Get the current node state of the VM for the given hostname If there is no such VM, return "TERMINATED" Create the configuration needed to create ``hostname`` in ... | 2.228892 | 2 |
app/back/mongo/data/collect/ports/mongo.py | jgphilpott/polyplot | 5 | 6631754 | from back.mongo.data.collect.ions import find_collection
from back.mongo.data.collect.ports.model import Port
collection = find_collection("ports")
def find_port(query={}, filter={"_id": 0}):
return dict(collection.find_one(query, filter))
def find_ports(query={}, filter={"_id": 0}, sort=[("properties.flow", -1... | from back.mongo.data.collect.ions import find_collection
from back.mongo.data.collect.ports.model import Port
collection = find_collection("ports")
def find_port(query={}, filter={"_id": 0}):
return dict(collection.find_one(query, filter))
def find_ports(query={}, filter={"_id": 0}, sort=[("properties.flow", -1... | none | 1 | 2.501165 | 3 | |
libs/python-axolotl/axolotl/state/signedprekeyrecord.py | akshitpradhan/TomHack | 4 | 6631755 | # -*- coding; utf-8 -*-
from .storageprotos_pb2 import SignedPreKeyRecordStructure
from ..ecc.curve import Curve
from ..ecc.eckeypair import ECKeyPair
class SignedPreKeyRecord:
def __init__(self, _id=None, timestamp=None, ecKeyPair=None, signature=None, serialized=None):
self.structure = SignedPreKeyReco... | # -*- coding; utf-8 -*-
from .storageprotos_pb2 import SignedPreKeyRecordStructure
from ..ecc.curve import Curve
from ..ecc.eckeypair import ECKeyPair
class SignedPreKeyRecord:
def __init__(self, _id=None, timestamp=None, ecKeyPair=None, signature=None, serialized=None):
self.structure = SignedPreKeyReco... | en | 0.712927 | # -*- coding; utf-8 -*- | 2.428625 | 2 |
mix-list/mixlist01.py | MarkDuenas/mycode | 0 | 6631756 | #!/usr/bin/env python3
my_list = ["192.168.0.5", 5060, "UP"]
print("The first item in the list (IP): " + my_list[0])
print("The second item in the list (port): " + str(my_list[1]))
print("The last item in the list (state): " + my_list[2])
# display only the IP addresses to the screen.
iplist = [5060, "80", 55, "1... | #!/usr/bin/env python3
my_list = ["192.168.0.5", 5060, "UP"]
print("The first item in the list (IP): " + my_list[0])
print("The second item in the list (port): " + str(my_list[1]))
print("The last item in the list (state): " + my_list[2])
# display only the IP addresses to the screen.
iplist = [5060, "80", 55, "1... | en | 0.380202 | #!/usr/bin/env python3 # display only the IP addresses to the screen. # example 1 - add up the strings # example 2 - use the comma separator # example 3 - use an 'f-string' | 4.120486 | 4 |
scripts/venv/lib/python2.7/site-packages/ete2/tools/phylobuild_lib/task/fasttree.py | sauloal/cnidaria | 3 | 6631757 | # #START_LICENSE###########################################################
#
#
# This file is part of the Environment for Tree Exploration program
# (ETE). http://etetoolkit.org
#
# ETE is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# t... | # #START_LICENSE###########################################################
#
#
# This file is part of the Environment for Tree Exploration program
# (ETE). http://etetoolkit.org
#
# ETE is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# t... | en | 0.686451 | # #START_LICENSE########################################################### # # # This file is part of the Environment for Tree Exploration program # (ETE). http://etetoolkit.org # # ETE is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the... | 1.709039 | 2 |
binding.gyp | HexF/node-waitpid | 3 | 6631758 | <gh_stars>1-10
{
"targets": [
{
"target_name": "waitpid",
"sources": [ "src/waitpid.cc" ]
}
]
}
| {
"targets": [
{
"target_name": "waitpid",
"sources": [ "src/waitpid.cc" ]
}
]
} | none | 1 | 1.05333 | 1 | |
setup.py | rebeccaserramari/Haplotype_blockparsing | 0 | 6631759 | from distutils.core import setup
from distutils.extension import Extension
from Cython.Build import cythonize
from Cython.Distutils import build_ext
ext_modules = [Extension("blockparser", ["blockparser.pyx", "DP_matrix.cpp"], language='c++',extra_compile_args=["-std=c++11", "-O2"], extra_link_args=["-std=c++11... | from distutils.core import setup
from distutils.extension import Extension
from Cython.Build import cythonize
from Cython.Distutils import build_ext
ext_modules = [Extension("blockparser", ["blockparser.pyx", "DP_matrix.cpp"], language='c++',extra_compile_args=["-std=c++11", "-O2"], extra_link_args=["-std=c++11... | none | 1 | 1.568971 | 2 | |
check_homework.py | zuzannnaobajtek/github-cmake-project-checker | 1 | 6631760 | <gh_stars>1-10
from argparse import ArgumentParser
from project_checker.checker.pull_all_links import make_default_config
from project_checker.checker.pull_all_links import check_homework_by_configuration
def make_program_arg_parser():
parser = ArgumentParser(prog='check homework')
parser.add_argument('-r', '-... | from argparse import ArgumentParser
from project_checker.checker.pull_all_links import make_default_config
from project_checker.checker.pull_all_links import check_homework_by_configuration
def make_program_arg_parser():
parser = ArgumentParser(prog='check homework')
parser.add_argument('-r', '--only-repositor... | none | 1 | 2.734619 | 3 | |
paz/pipelines/pose.py | niqbal996/paz | 300 | 6631761 | from ..abstract import Processor, SequentialProcessor
from .. import processors as pr
from .detection import HaarCascadeFrontalFace
from .keypoints import FaceKeypointNet2D32
import numpy as np
FACE_KEYPOINTNET3D = np.array([
[-220, 678, 1138], # left--center-eye
[+220, 678, 1138], # right-center-eye
[... | from ..abstract import Processor, SequentialProcessor
from .. import processors as pr
from .detection import HaarCascadeFrontalFace
from .keypoints import FaceKeypointNet2D32
import numpy as np
FACE_KEYPOINTNET3D = np.array([
[-220, 678, 1138], # left--center-eye
[+220, 678, 1138], # right-center-eye
[... | en | 0.735551 | # left--center-eye # right-center-eye # left--eye close to nose # left--eye close to ear # right-eye close to nose # right-eye close to ear # left--eyebrow close to nose # left--eyebrow close to ear # right-eyebrow close to nose # right-eyebrow close to ear # nose # lefty-lip # right-lip # up---lip # down-lip Pose esti... | 2.528151 | 3 |
model/Reff_constants.py | tdennisliu/covid19-forecasting-aus | 7 | 6631762 | public_holidays ={
'ACT': {
"2020-01-01": "New Year's Day",
"2020-01-27": "Australia Day",
"2020-03-09": "Canberra Day",
"2020-04-10": "Good Friday",
"2020-04-11": "Easter Saturday",
"2020-04-12": "Easter Sunday",
"2020-04-13": "Easter Monday",
"2020-0... | public_holidays ={
'ACT': {
"2020-01-01": "New Year's Day",
"2020-01-27": "Australia Day",
"2020-03-09": "Canberra Day",
"2020-04-10": "Good Friday",
"2020-04-11": "Easter Saturday",
"2020-04-12": "Easter Sunday",
"2020-04-13": "Easter Monday",
"2020-0... | none | 1 | 1.514108 | 2 | |
cycle_leds.py | akaplo/METARMap | 0 | 6631763 | import board
import neopixel
import time
import os
LED_COUNT = 50 # Number of LED pixels.
LED_PIN = board.D18 # GPIO pin connected to the pixels (18 is PCM).
LED_ORDER = neopixel.RGB # Strip type and colour ordering
LED_BRIGHTNESS = 0.5
pixels = neopixel.NeoPixel(LED_PIN, LED_COUNT, brightness = LED_BRIGHTNESS)... | import board
import neopixel
import time
import os
LED_COUNT = 50 # Number of LED pixels.
LED_PIN = board.D18 # GPIO pin connected to the pixels (18 is PCM).
LED_ORDER = neopixel.RGB # Strip type and colour ordering
LED_BRIGHTNESS = 0.5
pixels = neopixel.NeoPixel(LED_PIN, LED_COUNT, brightness = LED_BRIGHTNESS)... | en | 0.917117 | # Number of LED pixels. # GPIO pin connected to the pixels (18 is PCM). # Strip type and colour ordering # turn them all on in groups of 10 # now turn them all off | 3.362067 | 3 |
qiskit_experiments/library/characterization/analysis/local_readout_error_analysis.py | QuantumHardware/qiskit-experiments | 1 | 6631764 | # This code is part of Qiskit.
#
# (C) Copyright IBM 2021, 2022.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | # This code is part of Qiskit.
#
# (C) Copyright IBM 2021, 2022.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | en | 0.786827 | # This code is part of Qiskit. # # (C) Copyright IBM 2021, 2022. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivat... | 2.939578 | 3 |
06.EntryFeild/04.TextInput.py | sarincr/Python-App-Development-using-Kivy | 1 | 6631765 | <gh_stars>1-10
from kivy.app import App
from kivy.uix.textinput import TextInput
class SimpleApp(App):
def build(self):
t = TextInput(font_size=150)
return t
if __name__ == "__main__":
SimpleApp().run()
| from kivy.app import App
from kivy.uix.textinput import TextInput
class SimpleApp(App):
def build(self):
t = TextInput(font_size=150)
return t
if __name__ == "__main__":
SimpleApp().run() | none | 1 | 2.197716 | 2 | |
src/tests/tests.py | mariiashybetska/currency_exchange | 0 | 6631766 | import pytest
import requests
from decimal import Decimal
from django.urls import reverse
from currency.tasks import _pb, _mono
from currency.models import Rate
def test_sanity():
assert 200 == 200
def test_index_page(client):
url = reverse('index')
response = client.get(url)
assert response.statu... | import pytest
import requests
from decimal import Decimal
from django.urls import reverse
from currency.tasks import _pb, _mono
from currency.models import Rate
def test_sanity():
assert 200 == 200
def test_index_page(client):
url = reverse('index')
response = client.get(url)
assert response.statu... | en | 0.970571 | # homework | 2.17094 | 2 |
puntosvista/migrations/0005_auto_20210913_1533.py | ErickMurillo/cantera | 0 | 6631767 | <gh_stars>0
# Generated by Django 2.1.7 on 2021-09-13 15:33
from django.db import migrations
import sorl.thumbnail.fields
class Migration(migrations.Migration):
dependencies = [
('puntosvista', '0004_auto_20190923_0906'),
]
operations = [
migrations.AlterField(
model_name='p... | # Generated by Django 2.1.7 on 2021-09-13 15:33
from django.db import migrations
import sorl.thumbnail.fields
class Migration(migrations.Migration):
dependencies = [
('puntosvista', '0004_auto_20190923_0906'),
]
operations = [
migrations.AlterField(
model_name='puntos',
... | en | 0.781801 | # Generated by Django 2.1.7 on 2021-09-13 15:33 | 1.334535 | 1 |
solutions/2020/kws/day_12.py | kws/AdventOfCode | 1 | 6631768 | #!/usr/bin/env python
import argparse
import math
from collections import namedtuple
from time import sleep
Coordinates = namedtuple('Coordinates', 'x y')
class Ship:
def __init__(self, x, y, heading: int):
self.x = x
self.y = y
self.heading = heading
def __repr__(self):
x =... | #!/usr/bin/env python
import argparse
import math
from collections import namedtuple
from time import sleep
Coordinates = namedtuple('Coordinates', 'x y')
class Ship:
def __init__(self, x, y, heading: int):
self.x = x
self.y = y
self.heading = heading
def __repr__(self):
x =... | ru | 0.26433 | #!/usr/bin/env python | 3.758711 | 4 |
CNN/model.py | woodyZootopia/CuneiformSeg | 2 | 6631769 | from keras import backend as K
from keras.engine.topology import Input, Container
from keras.models import Model
from keras.layers import *
from keras.optimizers import *
K.set_image_dim_ordering("tf")
print("image_dim_ordering:tf")
def get_net(size, classes, session=None):
inputs = Input(shape=(size, size, 3))... | from keras import backend as K
from keras.engine.topology import Input, Container
from keras.models import Model
from keras.layers import *
from keras.optimizers import *
K.set_image_dim_ordering("tf")
print("image_dim_ordering:tf")
def get_net(size, classes, session=None):
inputs = Input(shape=(size, size, 3))... | en | 0.427973 | # out = GlobalAveragePooling2D()(out) | 2.891778 | 3 |
owlbear/request.py | gsmcwhirter/owlbear | 0 | 6631770 | # -*- coding: utf-8 -*-
"""Classes wrapping ASGI requests in a nicer interface"""
import http.cookies
import re
from typing import Tuple
import urllib.parse
class FormDataError(Exception):
"""Represents an error handling form data"""
pass
class RequestData:
"""Simple object container for attaching data... | # -*- coding: utf-8 -*-
"""Classes wrapping ASGI requests in a nicer interface"""
import http.cookies
import re
from typing import Tuple
import urllib.parse
class FormDataError(Exception):
"""Represents an error handling form data"""
pass
class RequestData:
"""Simple object container for attaching data... | en | 0.54917 | # -*- coding: utf-8 -*- Classes wrapping ASGI requests in a nicer interface Represents an error handling form data Simple object container for attaching data to a request # parts from https://github.com/defnull/multipart/blob/master/multipart.py # MIT license Copyright (c) 2010, <NAME> # key=value part of an Content-Ty... | 2.832234 | 3 |
pygmmis.py | pmelchior/iemgmm | 0 | 6631771 | from __future__ import division
import numpy as np
import scipy.special, scipy.stats
import ctypes
import logging
logger = logging.getLogger("pygmmis")
# set up multiprocessing
import multiprocessing
import parmap
def createShared(a, dtype=ctypes.c_double):
"""Create a shared array to be used for multiprocessing... | from __future__ import division
import numpy as np
import scipy.special, scipy.stats
import ctypes
import logging
logger = logging.getLogger("pygmmis")
# set up multiprocessing
import multiprocessing
import parmap
def createShared(a, dtype=ctypes.c_double):
"""Create a shared array to be used for multiprocessing... | en | 0.826652 | # set up multiprocessing Create a shared array to be used for multiprocessing's processes. Taken from http://stackoverflow.com/questions/5549190/ Works only for float, double, int, long types (e.g. no bool). Args: numpy array, arbitrary shape Returns: numpy array whose container is a... | 3.039085 | 3 |
setup.py | quiqueporta/bendercito | 2 | 6631772 | from setuptools import setup
from bendercito import __version__
setup(name='bendercito',
version=__version__,
description="Change your Slack status from command-line.",
long_description=open('README.md').read(),
classifiers=[
'Development Status :: 4 - Beta',
'Environment ::... | from setuptools import setup
from bendercito import __version__
setup(name='bendercito',
version=__version__,
description="Change your Slack status from command-line.",
long_description=open('README.md').read(),
classifiers=[
'Development Status :: 4 - Beta',
'Environment ::... | none | 1 | 1.545923 | 2 | |
msgraph-cli-extensions/beta/education_beta/azext_education_beta/generated/commands.py | thewahome/msgraph-cli | 0 | 6631773 | <reponame>thewahome/msgraph-cli
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Gene... | # --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incor... | en | 0.585472 | # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incor... | 1.414257 | 1 |
useful_layers/layers/__init__.py | jernsting/useful_layers | 0 | 6631774 | <reponame>jernsting/useful_layers
from useful_layers.layers.squeeze_and_excitation import *
from useful_layers.layers.channel_attention import *
from useful_layers.layers.spatial_attention import *
| from useful_layers.layers.squeeze_and_excitation import *
from useful_layers.layers.channel_attention import *
from useful_layers.layers.spatial_attention import * | none | 1 | 1.014967 | 1 | |
tests/testapp/urls.py | Brown-University-Library/django-select2 | 0 | 6631775 | <gh_stars>0
# -*- conding:utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django.conf.urls import include, url
from .forms import (
AddressChainedSelect2WidgetForm, AlbumModelSelect2WidgetForm,
HeavySelect2MultipleWidgetForm, HeavySelect2WidgetForm,
ModelSelect2TagWidgetForm, Selec... | # -*- conding:utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django.conf.urls import include, url
from .forms import (
AddressChainedSelect2WidgetForm, AlbumModelSelect2WidgetForm,
HeavySelect2MultipleWidgetForm, HeavySelect2WidgetForm,
ModelSelect2TagWidgetForm, Select2WidgetForm... | en | 0.910848 | # -*- conding:utf-8 -*- | 2.009156 | 2 |
tests/user_info/test_add_user_info.py | yulgul/api_tests_store | 0 | 6631776 | <filename>tests/user_info/test_add_user_info.py
from fixtures.constants import ResponseText
from fixtures.user_info.model import AddUserInfo, AddUserInfoResponse
class TestAddUserInfo:
def test_add_user_info_with_valid_data(self, app, auth_user):
"""
1. Try to register user with valid data
... | <filename>tests/user_info/test_add_user_info.py
from fixtures.constants import ResponseText
from fixtures.user_info.model import AddUserInfo, AddUserInfoResponse
class TestAddUserInfo:
def test_add_user_info_with_valid_data(self, app, auth_user):
"""
1. Try to register user with valid data
... | en | 0.81647 | 1. Try to register user with valid data 2. Check that status code is 201 3. Check response # 1. Try to register user with valid data 2. Check that status code is 201 3. Check response # | 2.804792 | 3 |
smrf/spatial/idw.py | scotthavens/smrf | 0 | 6631777 | <reponame>scotthavens/smrf
'''
2015-11-30 <NAME>
updated 2015-12-31 <NAME>
- start using panda dataframes to help keep track of stations
Distributed forcing data over a grid using different methods
'''
import numpy as np
class IDW:
'''
Inverse distance weighting class for distributing input data. Availa... | '''
2015-11-30 <NAME>
updated 2015-12-31 <NAME>
- start using panda dataframes to help keep track of stations
Distributed forcing data over a grid using different methods
'''
import numpy as np
class IDW:
'''
Inverse distance weighting class for distributing input data. Availables
options are:
... | en | 0.725034 | 2015-11-30 <NAME> updated 2015-12-31 <NAME> - start using panda dataframes to help keep track of stations Distributed forcing data over a grid using different methods Inverse distance weighting class for distributing input data. Availables options are: * Standard IDW * Detrended IDW Args: ... | 3.054581 | 3 |
webapp/lesson/forms.py | Ilyaivanov60/web_dictionary | 0 | 6631778 | from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField
class lessonForm(FlaskForm):
create = SubmitField('Создать', render_kw={"class": "btn btn-primary"})
| from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField
class lessonForm(FlaskForm):
create = SubmitField('Создать', render_kw={"class": "btn btn-primary"})
| none | 1 | 2.235399 | 2 | |
kerbal_api/cfg_parser/constants.py | obi1kenobi/kerbal-api | 3 | 6631779 | import re
# Localization tags of the form "#autoLOC_123456" are generally followed by a comment
# that may include the same localization tag and an "=" sign, followed by the English text.
# This pattern matches localized values, extracting:
# - the tag value, under group name "tag"
# - the English text, under ... | import re
# Localization tags of the form "#autoLOC_123456" are generally followed by a comment
# that may include the same localization tag and an "=" sign, followed by the English text.
# This pattern matches localized values, extracting:
# - the tag value, under group name "tag"
# - the English text, under ... | en | 0.742654 | # Localization tags of the form "#autoLOC_123456" are generally followed by a comment # that may include the same localization tag and an "=" sign, followed by the English text. # This pattern matches localized values, extracting: # - the tag value, under group name "tag" # - the English text, under group name "english... | 3.042198 | 3 |
Code/scripts/notebook_utils.py | madHatter106/Bayesian_TOA_ML | 0 | 6631780 | import numpy as np
import matplotlib.pyplot as pl
import pandas as pd
from seaborn import heatmap
from cmocean import cm as cmo
def plot_pca_res(pca_machine, threshold=0.85, alpha=1,
num_pca_disp=None, ax=None):
"""Plot PCA results."""
if ax is None:
_, ax = pl.subplots(figsize=(12, 10)... | import numpy as np
import matplotlib.pyplot as pl
import pandas as pd
from seaborn import heatmap
from cmocean import cm as cmo
def plot_pca_res(pca_machine, threshold=0.85, alpha=1,
num_pca_disp=None, ax=None):
"""Plot PCA results."""
if ax is None:
_, ax = pl.subplots(figsize=(12, 10)... | en | 0.796139 | Plot PCA results. | 2.768547 | 3 |
codigo_das_aulas/aula_06/aula_06_4.py | VeirichR/curso-python-selenium | 234 | 6631781 | from selenium.webdriver import Firefox
b = Firefox()
url = 'http://selenium.dunossauro.live/aula_06.html'
b.get(url)
| from selenium.webdriver import Firefox
b = Firefox()
url = 'http://selenium.dunossauro.live/aula_06.html'
b.get(url)
| none | 1 | 2.00657 | 2 | |
apim-migration-testing-tool/Python/venv/lib/python3.6/site-packages/ortools/sat/python/cp_model_helper.py | tharindu1st/apim-migration-resources | 0 | 6631782 | <filename>apim-migration-testing-tool/Python/venv/lib/python3.6/site-packages/ortools/sat/python/cp_model_helper.py<gh_stars>0
# Copyright 2010-2018 Google LLC
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of ... | <filename>apim-migration-testing-tool/Python/venv/lib/python3.6/site-packages/ortools/sat/python/cp_model_helper.py<gh_stars>0
# Copyright 2010-2018 Google LLC
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of ... | en | 0.843315 | # Copyright 2010-2018 Google LLC # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing... | 2.102106 | 2 |
software/glasgow/applet/interface/spi_controller/__init__.py | electroniceel/Glasgow | 1,014 | 6631783 | <reponame>electroniceel/Glasgow
import struct
import logging
import asyncio
import math
from nmigen.compat import *
from nmigen.compat.genlib.cdc import *
from ....support.logging import *
from ....gateware.clockgen import *
from ... import *
class SPIControllerBus(Module):
def __init__(self, pads, sck_idle, sck... | import struct
import logging
import asyncio
import math
from nmigen.compat import *
from nmigen.compat.genlib.cdc import *
from ....support.logging import *
from ....gateware.clockgen import *
from ... import *
class SPIControllerBus(Module):
def __init__(self, pads, sck_idle, sck_edge, cs_active):
self.... | en | 0.547555 | # CMD_SHIFT ### Initiate transactions on the SPI bus. # 2 cyc MultiReg delay from SCK to CIPO requires a 4 cyc # period with current implementation of SERDES # ------------------------------------------------------------------------------------------------- | 2.124036 | 2 |
qnarre/base/doc.py | quantapix/qnarre.com | 0 | 6631784 | # Copyright 2019 Quantapix 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 applicable l... | # Copyright 2019 Quantapix 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 applicable l... | en | 0.813792 | # Copyright 2019 Quantapix 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 applicable l... | 2.392159 | 2 |
src/toil_lib/test/__init__.py | BD2KGenomics/toil-lib | 4 | 6631785 | # Copyright (C) 2016 Regents of the University of California
#
# 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 applicab... | # Copyright (C) 2016 Regents of the University of California
#
# 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 applicab... | en | 0.854222 | # Copyright (C) 2016 Regents of the University of California # # 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 applicab... | 1.879953 | 2 |
graphvalues.py | ContinuumBridge/scripts | 0 | 6631786 | <reponame>ContinuumBridge/scripts<gh_stars>0
#!/usr/bin/env python
# checkeew.py
# Copyright (C) ContinuumBridge Limited, 2013-14 - All Rights Reserved
# Unauthorized copying of this file, via any medium is strictly prohibited
# Proprietary and confidential
# Written by <NAME>
#
SENSORS = ['temperature','ir_temperature... | #!/usr/bin/env python
# checkeew.py
# Copyright (C) ContinuumBridge Limited, 2013-14 - All Rights Reserved
# Unauthorized copying of this file, via any medium is strictly prohibited
# Proprietary and confidential
# Written by <NAME>
#
SENSORS = ['temperature','ir_temperature', 'rel_humidity']
# Include the Dropbox SD... | en | 0.682063 | #!/usr/bin/env python # checkeew.py # Copyright (C) ContinuumBridge Limited, 2013-14 - All Rights Reserved # Unauthorized copying of this file, via any medium is strictly prohibited # Proprietary and confidential # Written by <NAME> # # Include the Dropbox SDK Return a pretty, aligned string representation of a nxm mat... | 2.787433 | 3 |
trebelge/XMLFileProcessStrategy/XMLFileProcessStrategy.py | askmetoo/trebelge | 0 | 6631787 | <filename>trebelge/XMLFileProcessStrategy/XMLFileProcessStrategy.py
from abc import ABC, abstractmethod
from trebelge.XMLFileProcessStrategy import XMLFileProcessStrategyContext
class XMLFileProcessStrategy(ABC):
"""
The Strategy interface declares operations common to all supported versions
of some algo... | <filename>trebelge/XMLFileProcessStrategy/XMLFileProcessStrategy.py
from abc import ABC, abstractmethod
from trebelge.XMLFileProcessStrategy import XMLFileProcessStrategyContext
class XMLFileProcessStrategy(ABC):
"""
The Strategy interface declares operations common to all supported versions
of some algo... | en | 0.82851 | The Strategy interface declares operations common to all supported versions of some algorithm. The Context uses this interface to call the algorithm defined by Concrete Strategies. | 2.77782 | 3 |
flash/image/detection/finetuning.py | tszumowski/lightning-flash | 0 | 6631788 | # Copyright The PyTorch Lightning 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 by applicable law or agreed to i... | # Copyright The PyTorch Lightning 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 by applicable law or agreed to i... | en | 0.869033 | # Copyright The PyTorch Lightning 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 by applicable law or agreed to i... | 1.735695 | 2 |
src/skmultiflow/trees/gaussian_estimator.py | AndreFCruz/scikit-multiflow | 1 | 6631789 | import math
from skmultiflow.utils.statistics import normal_probability
class GaussianEstimator(object):
""" GaussianEstimator
Gaussian incremental estimator that uses incremental method that is more resistant to floating point imprecision.
For more info, <NAME>'s "The Art of Computer Programming, Volume ... | import math
from skmultiflow.utils.statistics import normal_probability
class GaussianEstimator(object):
""" GaussianEstimator
Gaussian incremental estimator that uses incremental method that is more resistant to floating point imprecision.
For more info, <NAME>'s "The Art of Computer Programming, Volume ... | en | 0.5981 | GaussianEstimator Gaussian incremental estimator that uses incremental method that is more resistant to floating point imprecision. For more info, <NAME>'s "The Art of Computer Programming, Volume 2: Seminumerical Algorithms", section 4.2.2. add_observation Adds a new observation and updates statistics... | 3.434069 | 3 |
websocks/utils.py | abersheeran/websocks | 91 | 6631790 | import asyncio
import os
import threading
from asyncio import AbstractEventLoop, Task, Future
from typing import Tuple, Dict, Any, Set, Optional, Coroutine
class Singleton(type):
def __init__(
cls,
name: str,
bases: Tuple[type],
namespace: Dict[str, Any],
) -> None:
cls... | import asyncio
import os
import threading
from asyncio import AbstractEventLoop, Task, Future
from typing import Tuple, Dict, Any, Set, Optional, Coroutine
class Singleton(type):
def __init__(
cls,
name: str,
bases: Tuple[type],
namespace: Dict[str, Any],
) -> None:
cls... | en | 0.862375 | Execute multiple coroutines concurrently, returning only the results of the first execution. When one is completed, the execution of other coroutines will be canceled. # nothing to do on onlyfirst cancelled # record first completed future An object that can be used to store arbitrary state. 设定系统的网络代理 获取系统的网络代理设置 | 2.841775 | 3 |
Calibration/HcalAlCaRecoProducers/test/AlCaHBHEMuonProducerFilter_cfg.py | malbouis/cmssw | 852 | 6631791 | import FWCore.ParameterSet.Config as cms
from Configuration.Eras.Era_Run2_2018_cff import Run2_2018
process = cms.Process("AlCaHBHEMuon",Run2_2018)
process.load('Configuration.StandardSequences.Services_cff')
process.load('FWCore.MessageService.MessageLogger_cfi')
process.load("Configuration.StandardSequences.Geometr... | import FWCore.ParameterSet.Config as cms
from Configuration.Eras.Era_Run2_2018_cff import Run2_2018
process = cms.Process("AlCaHBHEMuon",Run2_2018)
process.load('Configuration.StandardSequences.Services_cff')
process.load('FWCore.MessageService.MessageLogger_cfi')
process.load("Configuration.StandardSequences.Geometr... | en | 0.651961 | # Path and EndPath definitions # Schedule definition | 1.485067 | 1 |
geo-analytical-app/app.py | ckurze/mongodb-hivemq-iot-demo | 2 | 6631792 | <filename>geo-analytical-app/app.py
# Nice introduction to maps in plotly: https://medium.com/analytics-vidhya/introduction-to-interactive-geoplots-with-plotly-and-mapbox-9249889358eb
import os
import dash
import dash_core_components as dcc
import dash_html_components as html
import dash_bootstrap_components as dbc
f... | <filename>geo-analytical-app/app.py
# Nice introduction to maps in plotly: https://medium.com/analytics-vidhya/introduction-to-interactive-geoplots-with-plotly-and-mapbox-9249889358eb
import os
import dash
import dash_core_components as dcc
import dash_html_components as html
import dash_bootstrap_components as dbc
f... | en | 0.70264 | # Nice introduction to maps in plotly: https://medium.com/analytics-vidhya/introduction-to-interactive-geoplots-with-plotly-and-mapbox-9249889358eb # Hint to leverage the index # Data for real-time map #pd.DataFrame(columns=['truck', 'lat', 'lon', 'routeId', 'speed', 'speedLimit', 'break']) #current_truck_locations.set... | 2.6509 | 3 |
src/homepage/views/index.py | cruzaria/DMRP | 0 | 6631793 | from django.conf import settings
from django_mako_plus import view_function, jscontext
from datetime import datetime, timedelta
@view_function
def process_request(request):
context = {
jscontext('now'): datetime.now(),
}
return request.dmp.render('index.html', context)
@view_function
def gettime(... | from django.conf import settings
from django_mako_plus import view_function, jscontext
from datetime import datetime, timedelta
@view_function
def process_request(request):
context = {
jscontext('now'): datetime.now(),
}
return request.dmp.render('index.html', context)
@view_function
def gettime(... | en | 0.303878 | # return CSV #return request.dmp.render('my_csv.html', {}, content_type='text/csv') # return a custom error page #return request.dmp.render('custom_error_page.html', {}, status=404) # specify a different template charset (or set globally in settings.py) #return request.dmp.render('im_old.html', {}, content_type='cp1252... | 2.031145 | 2 |
flask_service/source_files/endpoint.py | Project-semyonov/adam | 0 | 6631794 |
from flask import Flask
from flask_restful import Api, Resource, reqparse
import time
import json
from datetime import datetime, timedelta
app = Flask(__name__)
api = Api(app)
epoch = time.time()
time_start = (datetime.now()-timedelta(hours=.5)).timestamp()
print(type(time_start))
time_end = datetime.now().timestamp... |
from flask import Flask
from flask_restful import Api, Resource, reqparse
import time
import json
from datetime import datetime, timedelta
app = Flask(__name__)
api = Api(app)
epoch = time.time()
time_start = (datetime.now()-timedelta(hours=.5)).timestamp()
print(type(time_start))
time_end = datetime.now().timestamp... | en | 0.614656 | # therm_list = [{x:y} for x in range(time_start, time_end)] # def put(self, temp): # pass # def post(self, temp): # pass # def delete(self, temp): # pass # | 2.940197 | 3 |
CIM14/CDPSM/Balanced/IEC61970/Core/Equipment.py | MaximeBaudette/PyCIM | 58 | 6631795 | # Copyright (C) 2010-2011 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distrib... | # Copyright (C) 2010-2011 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distrib... | en | 0.802352 | # Copyright (C) 2010-2011 <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distrib... | 1.66806 | 2 |
neutron/tests/functional/agent/l2/extensions/test_ovs_agent_qos_extension.py | EwaldvanGeffen/neutron | 1 | 6631796 | # Copyright (c) 2015 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | # Copyright (c) 2015 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | en | 0.896847 | # Copyright (c) 2015 Red Hat, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless require... | 1.343497 | 1 |
gym_ucv/__init__.py | mkisantal/gym-ucv-control | 0 | 6631797 | <reponame>mkisantal/gym-ucv-control
from gym.envs.registration import register
register(
id='ucv-v0',
entry_point='gym_ucv.envs:UcvEnv',
)
| from gym.envs.registration import register
register(
id='ucv-v0',
entry_point='gym_ucv.envs:UcvEnv',
) | none | 1 | 1.286423 | 1 | |
graph_construction/get_diagnosis_strings.py | EmmaRocheteau/eICU-GNN-LSTM | 53 | 6631798 | <reponame>EmmaRocheteau/eICU-GNN-LSTM
import pandas as pd
import json
with open('paths.json', 'r') as f:
eICU_path = json.load(f)["eICU_path"]
train_diagnoses = pd.read_csv('{}train/diagnoses.csv'.format(eICU_path), index_col='patient')
val_diagnoses = pd.read_csv('{}val/diagnoses.csv'.format(eICU_path), index_co... | import pandas as pd
import json
with open('paths.json', 'r') as f:
eICU_path = json.load(f)["eICU_path"]
train_diagnoses = pd.read_csv('{}train/diagnoses.csv'.format(eICU_path), index_col='patient')
val_diagnoses = pd.read_csv('{}val/diagnoses.csv'.format(eICU_path), index_col='patient')
test_diagnoses = pd.read_... | en | 0.890801 | # some quick cleaning i.e. remove classes and subclasses, get rid of strange words and characters # get rid of non-useful text # hacky way to quickly get indexable list # check in the rest of the strings for overlap | 2.75201 | 3 |
bloomcast/main.py | SalishSeaCast/SOG-Bloomcast-Ensemble | 1 | 6631799 | # Copyright 2011-2021 <NAME> and The University 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 appli... | # Copyright 2011-2021 <NAME> and The University 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 appli... | en | 0.833746 | # Copyright 2011-2021 <NAME> and The University 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 applicab... | 1.713961 | 2 |
pive/inputmanager.py | internet-sicherheit/pive | 8 | 6631800 | <gh_stars>1-10
# Copyright (c) 2014 - 2015, <NAME>
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice,
# this list of condit... | # Copyright (c) 2014 - 2015, <NAME>
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the fo... | en | 0.69546 | # Copyright (c) 2014 - 2015, <NAME> # All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and the foll... | 1.300688 | 1 |
solutions/1037_valid_boomerang.py | YiqunPeng/leetcode_pro | 0 | 6631801 | <reponame>YiqunPeng/leetcode_pro<gh_stars>0
class Solution:
def isBoomerang(self, points: List[List[int]]) -> bool:
ab = (points[1][0] - points[0][0], points[1][1] - points[0][1])
bc = (points[2][0] - points[1][0], points[2][1] - points[1][1])
return ab != (0, 0) and bc != (0, 0) and ab[0] *... | class Solution:
def isBoomerang(self, points: List[List[int]]) -> bool:
ab = (points[1][0] - points[0][0], points[1][1] - points[0][1])
bc = (points[2][0] - points[1][0], points[2][1] - points[1][1])
return ab != (0, 0) and bc != (0, 0) and ab[0] * bc[1] != ab[1] * bc[0] | none | 1 | 3.083099 | 3 | |
lib/pios/loader.py | creative-workflow/pi-setup | 1 | 6631802 | import sys, os, osx, linux
def is_linux():
return (sys.platform == 'linux' or sys.platform == 'linux2')
def is_osx():
return sys.platform == 'darwin'
def is_windows():
return sys.platform == 'win32'
def get_wrapper(wrapper = None):
if not wrapper:
if is_linux():
return linux.wrapper
if is_os... | import sys, os, osx, linux
def is_linux():
return (sys.platform == 'linux' or sys.platform == 'linux2')
def is_osx():
return sys.platform == 'darwin'
def is_windows():
return sys.platform == 'win32'
def get_wrapper(wrapper = None):
if not wrapper:
if is_linux():
return linux.wrapper
if is_os... | none | 1 | 3.122849 | 3 | |
scripts/speed_ch.py | vanttec/rb_missions | 0 | 6631803 | #!/usr/bin/env python
import rospy
from std_msgs.msg import String
from usv_perception.msg import obj_detected
from usv_perception.msg import obj_detected_list
from std_msgs.msg import Float32MultiArray
from std_msgs.msg import Int32
from geometry_msgs.msg import Pose2D
from sensor_msgs.msg import PointCloud2
import s... | #!/usr/bin/env python
import rospy
from std_msgs.msg import String
from usv_perception.msg import obj_detected
from usv_perception.msg import obj_detected_list
from std_msgs.msg import Float32MultiArray
from std_msgs.msg import Int32
from geometry_msgs.msg import Pose2D
from sensor_msgs.msg import PointCloud2
import s... | en | 0.152414 | #!/usr/bin/env python #EARTH_RADIUS = 6371000 #camera to ins offset def gps_point_trans(self,y,x): p = np.array([x,y]) J = np.array([[math.cos(self.yaw), -1*math.sin(self.yaw)],[math.sin(self.yaw), math.cos(self.yaw)]]) n = J.dot(p) phi1 = math.radians(self.lat) latitude2 = se... | 2.274906 | 2 |
python/search/find_common_sorted.py | amitsaha/playground | 4 | 6631804 | <reponame>amitsaha/playground<gh_stars>1-10
"""
Find the common elements among two sorted sets
Desired time complexity: O(m+n)
"""
# Uses a hash table (hence uses O(min(m,n)) extra storage
# space
# This doesn't need the arrays to be sorted
def find_common(hash_t, arr):
for item in arr:
if hash_t.has_key(... | """
Find the common elements among two sorted sets
Desired time complexity: O(m+n)
"""
# Uses a hash table (hence uses O(min(m,n)) extra storage
# space
# This doesn't need the arrays to be sorted
def find_common(hash_t, arr):
for item in arr:
if hash_t.has_key(item):
print item
d... | en | 0.713311 | Find the common elements among two sorted sets Desired time complexity: O(m+n) # Uses a hash table (hence uses O(min(m,n)) extra storage # space # This doesn't need the arrays to be sorted # No extra storage space # The array must be sorted # O(m+n) #find_sorted_hash(arr1, arr2) | 4.04682 | 4 |
tests/riscv/APIs/AccessReservedRegisterTest_force.py | Wlgen/force-riscv | 0 | 6631805 | #
# Copyright (C) [2020] Futurewei Technologies, Inc.
#
# FORCE-RISCV is licensed under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# THIS SOFTWARE IS PR... | #
# Copyright (C) [2020] Futurewei Technologies, Inc.
#
# FORCE-RISCV is licensed under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# THIS SOFTWARE IS PR... | en | 0.778858 | # # Copyright (C) [2020] Futurewei Technologies, Inc. # # FORCE-RISCV is licensed under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # THIS SOFTWARE IS PR... | 2.199697 | 2 |
Data Processing/Clustering/Using spark_and_numpy/bowl_npandspark.py | An5human/IPL-Stimulator | 1 | 6631806 | from pyspark.sql import SparkSession
from pyspark.ml.feature import StandardScaler
from pyspark.ml.linalg import Vectors
from pyspark.ml.feature import VectorAssembler
from pyspark.ml.clustering import KMeans
from pyspark.sql.functions import concat, col, lit
from pyspark.sql.window import *
from pyspark.sql.functions ... | from pyspark.sql import SparkSession
from pyspark.ml.feature import StandardScaler
from pyspark.ml.linalg import Vectors
from pyspark.ml.feature import VectorAssembler
from pyspark.ml.clustering import KMeans
from pyspark.sql.functions import concat, col, lit
from pyspark.sql.window import *
from pyspark.sql.functions ... | none | 1 | 2.789862 | 3 | |
bowling.py | kitestring/BowlingDataCenter | 1 | 6631807 | import random
from tkinter import * # @unusedwildimport
from tkinter import ttk # @importredefinition
from tkinter import filedialog # @importredefinition
import functools
import matplotlib
import matplotlib.pyplot as plt
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
from matplotlib.figure im... | import random
from tkinter import * # @unusedwildimport
from tkinter import ttk # @importredefinition
from tkinter import filedialog # @importredefinition
import functools
import matplotlib
import matplotlib.pyplot as plt
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
from matplotlib.figure im... | en | 0.759695 | # @unusedwildimport # @importredefinition # @importredefinition # @unresolvedimport # @unresolvedimport # @unresolvedimport # Create db object # Create and grid the outer content frame # Initialize the canvas and grit it # Create the remaining widgets # Grid the remaining widgets ## Query DB to initialize listboxes, # ... | 2.428066 | 2 |
docs/python/f_written_examination_2019-03-15_ex2.py | Voldemort373/Notes-and-Reference | 30 | 6631808 | <filename>docs/python/f_written_examination_2019-03-15_ex2.py
# -*- coding: utf-8 -*-
# Copyright (c) 2019, <NAME> <<EMAIL>>
#
# Permission to use, copy, modify, and/or distribute this software for any purpose
# with or without fee is hereby granted, provided that the above copyright notice
# and this permission notice... | <filename>docs/python/f_written_examination_2019-03-15_ex2.py
# -*- coding: utf-8 -*-
# Copyright (c) 2019, <NAME> <<EMAIL>>
#
# Permission to use, copy, modify, and/or distribute this software for any purpose
# with or without fee is hereby granted, provided that the above copyright notice
# and this permission notice... | en | 0.623941 | # -*- coding: utf-8 -*- # Copyright (c) 2019, <NAME> <<EMAIL>> # # Permission to use, copy, modify, and/or distribute this software for any purpose # with or without fee is hereby granted, provided that the above copyright notice # and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AN... | 3.601289 | 4 |
src/fomc_get_data/FomcStatement.py | michelleazee/centralbank_analysis | 18 | 6631809 | <gh_stars>10-100
from datetime import datetime
import threading
import sys
import os
import pickle
import re
import requests
from bs4 import BeautifulSoup
import numpy as np
import pandas as pd
# Import parent class
from .FomcBase import FomcBase
class FomcStatement(FomcBase):
'''
A convenient class for ext... | from datetime import datetime
import threading
import sys
import os
import pickle
import re
import requests
from bs4 import BeautifulSoup
import numpy as np
import pandas as pd
# Import parent class
from .FomcBase import FomcBase
class FomcStatement(FomcBase):
'''
A convenient class for extracting statement... | en | 0.8427 | # Import parent class A convenient class for extracting statement from the FOMC website Example Usage: fomc = FomcStatement() df = fomc.get_contents() Override private function that sets all the links for the contents to download on FOMC website from from_year (=min(2015, from_year)) to t... | 3.107317 | 3 |
src/gui/stdmenu.py | dougabugg/python-directory-statistics | 0 | 6631810 | <filename>src/gui/stdmenu.py<gh_stars>0
from tkinter import *
from tkinter.dialog import Dialog
from tkinter.filedialog import Open,SaveAs,Directory
from gui.walkstatus import WalkStatusPopup
from fstree.util import saveFile,loadFile
import os
class StandardMenu(Menu):
def __init__(self,callback=None,*a,**k):
... | <filename>src/gui/stdmenu.py<gh_stars>0
from tkinter import *
from tkinter.dialog import Dialog
from tkinter.filedialog import Open,SaveAs,Directory
from gui.walkstatus import WalkStatusPopup
from fstree.util import saveFile,loadFile
import os
class StandardMenu(Menu):
def __init__(self,callback=None,*a,**k):
... | en | 0.715456 | #TODO: actually set those accelerators? ## accelerator="Ctrl+N", ## accelerator="Ctrl+O", ## accelerator="Ctrl+S", #TODO: command for close option #do we want to prompt for unsave snapshot? ## ("Snapshot (lzma)",".json.xz"), ## ("Snapshot (gzip)","*.json.gz"), ## ... | 2.739969 | 3 |
main.py | rushilkhattar09/Indian-Art-Forms-Emotion-Detection- | 0 | 6631811 | import argparse
from webcam_utils import realtime_emotions
def run_realtime_emotion():
realtime_emotions()
def main():
run_realtime_emotion()
if __name__ == '__main__':
main()
| import argparse
from webcam_utils import realtime_emotions
def run_realtime_emotion():
realtime_emotions()
def main():
run_realtime_emotion()
if __name__ == '__main__':
main()
| none | 1 | 1.324415 | 1 | |
drssms/scripts/cli.py | hvgab/drssms | 0 | 6631812 | <reponame>hvgab/drssms
"""CLI for DRSSMS package."""
from drssms import NeverAPI
import click
import logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
@click.group()
def main():
"""Enter main script."""
# napi = NeverAPI()
# TODO: Move napi up here and use context
p... | """CLI for DRSSMS package."""
from drssms import NeverAPI
import click
import logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
@click.group()
def main():
"""Enter main script."""
# napi = NeverAPI()
# TODO: Move napi up here and use context
pass
@main.command()
@... | en | 0.714713 | CLI for DRSSMS package. Enter main script. # napi = NeverAPI() # TODO: Move napi up here and use context Send push SMS to number without service. Send service SMS to number, optionally overwrite text. Stop an active SMS dialog. Download sms dialog file. No options: get yesterday. Only start: 24hours from start... | 2.570096 | 3 |
sdk/python/pulumi_cloudflare/filter.py | pulumi/pulumi-cloudflare | 35 | 6631813 | <filename>sdk/python/pulumi_cloudflare/filter.py
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, O... | <filename>sdk/python/pulumi_cloudflare/filter.py
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, O... | en | 0.725062 | # coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** The set of arguments for constructing a Filter resource. :param pulumi.Input[str] expression: The filter expression to be used. ... | 2.071377 | 2 |
all_repos/source/github_forks.py | briandcho/all-repos | 350 | 6631814 | from typing import Dict
from typing import NamedTuple
from all_repos import github_api
from all_repos.util import hide_api_key_repr
class Settings(NamedTuple):
api_key: str
repo: str
collaborator: bool = True
forks: bool = True
private: bool = False
archived: bool = False
base_url: str = ... | from typing import Dict
from typing import NamedTuple
from all_repos import github_api
from all_repos.util import hide_api_key_repr
class Settings(NamedTuple):
api_key: str
repo: str
collaborator: bool = True
forks: bool = True
private: bool = False
archived: bool = False
base_url: str = ... | en | 0.752804 | # TODO: https://github.com/python/mypy/issues/8543 | 2.642232 | 3 |
preliminaries/01_create_labels.py | chrisdrymon/greek-morph-tagger | 9 | 6631815 | import os
from bs4 import BeautifulSoup
import pickle
from preliminaries.utilities_morph import create_morph_classes
agdt_folder = os.path.join('../data', 'corpora', 'greek', 'annotated', 'perseus-771dca2', 'texts')
gorman_folder = os.path.join('../data', 'corpora', 'greek', 'annotated', 'gorman')
all_files = []
for f... | import os
from bs4 import BeautifulSoup
import pickle
from preliminaries.utilities_morph import create_morph_classes
agdt_folder = os.path.join('../data', 'corpora', 'greek', 'annotated', 'perseus-771dca2', 'texts')
gorman_folder = os.path.join('../data', 'corpora', 'greek', 'annotated', 'gorman')
all_files = []
for f... | en | 0.935288 | # Create morphology aspect classes to simplify tensor sizing and file naming. Keep them in this order. # Change this to whichever aspect of morphology labels are needed for. # This is just a string that is used in the filename to be saved. # Search through every work in the annotated Greek folder # Open the files (they... | 2.758132 | 3 |
sample_matrix_widget.py | MarinaMeyta/WhoseCppCode | 1 | 6631816 | <reponame>MarinaMeyta/WhoseCppCode
from core.sample_matrix import get_sample_matrix
from ipywidgets import Button
from IPython.display import display, clear_output
# Путь к данным
path = './data/'
outpath = './data/matricies/'
def display_matrix_widget(path, outpath):
matrix_btn = Button(description='Получить ... | from core.sample_matrix import get_sample_matrix
from ipywidgets import Button
from IPython.display import display, clear_output
# Путь к данным
path = './data/'
outpath = './data/matricies/'
def display_matrix_widget(path, outpath):
matrix_btn = Button(description='Получить матрицу', tooltip='Click me',
... | ru | 0.996462 | # Путь к данным | 2.483927 | 2 |
common/utils/manopth/examples/manopth_demo.py | Alan-delete/I2L-MeshNet_RELEASE | 544 | 6631817 | import argparse
from matplotlib import pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import torch
from tqdm import tqdm
from manopth import argutils
from manopth.manolayer import ManoLayer
from manopth.demo import display_hand
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_a... | import argparse
from matplotlib import pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import torch
from tqdm import tqdm
from manopth import argutils
from manopth.manolayer import ManoLayer
from manopth.demo import display_hand
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_a... | en | 0.859467 | # Generate random pose coefficients # Hack to act like None for PyTorch JIT # Loop for forward/backward quick profiling # Forward pass # Backward pass # Draw obtained vertices and joints | 2.043217 | 2 |
blast.py | llrs/PYT-SBI | 5 | 6631818 | <filename>blast.py
#!/usr/bin/python3
# encoding: utf-8
"""This module provides a function to work with the online version of BLAST
provided by the NCBI.
@author: <NAME>, Ferran"""
import logging
import argparse
import os
import urllib
import ftplib
from Bio.Blast import NCBIWWW
from Bio.Blast import NCBIXML
from Bio... | <filename>blast.py
#!/usr/bin/python3
# encoding: utf-8
"""This module provides a function to work with the online version of BLAST
provided by the NCBI.
@author: <NAME>, Ferran"""
import logging
import argparse
import os
import urllib
import ftplib
from Bio.Blast import NCBIWWW
from Bio.Blast import NCBIXML
from Bio... | en | 0.781635 | #!/usr/bin/python3 # encoding: utf-8 This module provides a function to work with the online version of BLAST provided by the NCBI. @author: <NAME>, Ferran Runs a blast online. query is the file with the sequence. db is the db to do the blast usually nr or pdb. output is the file where the results will be ... | 2.960788 | 3 |
seapy/couplings/__init__.py | FRidh/seapy | 8 | 6631819 | <reponame>FRidh/seapy<filename>seapy/couplings/__init__.py
"""
Couplings
=========
.. toctree::
:maxdepth: 2
Module with all available couplings.
As a general note:
* Points have dimension 0
* Lines have dimension 1
* Surfaces have dimension 2
.. automodule:: seapy.couplings.coupling
.. automodule:: seapy.coup... | """
Couplings
=========
.. toctree::
:maxdepth: 2
Module with all available couplings.
As a general note:
* Points have dimension 0
* Lines have dimension 1
* Surfaces have dimension 2
.. automodule:: seapy.couplings.coupling
.. automodule:: seapy.couplings.couplingpointstructural
.. automodule:: seapy.coupli... | en | 0.606905 | Couplings ========= .. toctree:: :maxdepth: 2 Module with all available couplings. As a general note: * Points have dimension 0 * Lines have dimension 1 * Surfaces have dimension 2 .. automodule:: seapy.couplings.coupling .. automodule:: seapy.couplings.couplingpointstructural .. automodule:: seapy.couplings.... | 1.67611 | 2 |
utils/utils.py | asdacsd/Mall-Shop | 0 | 6631820 | import datetime
import time
from app_api.models import SysLog
def get_order_no():
year = datetime.datetime.now().year
month = datetime.datetime.now().month
day = datetime.datetime.now().day
if month < 10:
month = f'0{month}'
if day < 10:
day = f'0{day}'
return f'{year}{month}{... | import datetime
import time
from app_api.models import SysLog
def get_order_no():
year = datetime.datetime.now().year
month = datetime.datetime.now().month
day = datetime.datetime.now().day
if month < 10:
month = f'0{month}'
if day < 10:
day = f'0{day}'
return f'{year}{month}{... | none | 1 | 2.608581 | 3 | |
vnpy/trader/ui/mainwindow.py | bixia/MyVnpy | 0 | 6631821 | # -*- encoding: utf-8 -*-
'''
@File : mainwindow.py
@License : (C)Copyright 2017-2018, Liugroup-NLPR-CASIA
@Modify Time @Author @Version @Desciption
------------ ------- -------- -----------
2021/4/1 22:43 <NAME> 1.0 None
'''
from functools import partial
from PyQt5 imp... | # -*- encoding: utf-8 -*-
'''
@File : mainwindow.py
@License : (C)Copyright 2017-2018, Liugroup-NLPR-CASIA
@Modify Time @Author @Version @Desciption
------------ ------- -------- -----------
2021/4/1 22:43 <NAME> 1.0 None
'''
from functools import partial
from PyQt5 imp... | en | 0.408383 | # -*- encoding: utf-8 -*- @File : mainwindow.py @License : (C)Copyright 2017-2018, Liugroup-NLPR-CASIA @Modify Time @Author @Version @Desciption ------------ ------- -------- ----------- 2021/4/1 22:43 <NAME> 1.0 None Main window of VN trader init menu bar Initialize a d... | 2.021024 | 2 |
lowest-common-ancestor-of-a-binary-tree-ii/lowest-common-ancestor-of-a-binary-tree-ii.py | QQuinn03/LeetHub | 0 | 6631822 | <filename>lowest-common-ancestor-of-a-binary-tree-ii/lowest-common-ancestor-of-a-binary-tree-ii.py
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution:
def lowestCommonAncestor(self, root: '... | <filename>lowest-common-ancestor-of-a-binary-tree-ii/lowest-common-ancestor-of-a-binary-tree-ii.py
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution:
def lowestCommonAncestor(self, root: '... | en | 0.60307 | # Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None | 3.948271 | 4 |
alipay/aop/api/response/AlipayEbppInvoiceUserTradeQueryResponse.py | articuly/alipay-sdk-python-all | 0 | 6631823 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import simplejson as json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
from alipay.aop.api.domain.InvoiceTradeInfo import InvoiceTradeInfo
class AlipayEbppInvoiceUserTradeQueryResponse(AlipayResponse):
def __init__(self):
super(AlipayEbp... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import simplejson as json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
from alipay.aop.api.domain.InvoiceTradeInfo import InvoiceTradeInfo
class AlipayEbppInvoiceUserTradeQueryResponse(AlipayResponse):
def __init__(self):
super(AlipayEbp... | en | 0.352855 | #!/usr/bin/env python # -*- coding: utf-8 -*- | 2.362891 | 2 |
gocomics_downloader/constants.py | PythonCoderAS/GoComics-Downloader | 1 | 6631824 | <filename>gocomics_downloader/constants.py<gh_stars>1-10
import datetime
import mainchecker
mainchecker.check_for_main()
image_class = 'img-fluid item-comic-image' # the class used to find the picture element
one_day = datetime.timedelta(days=1) # one day
| <filename>gocomics_downloader/constants.py<gh_stars>1-10
import datetime
import mainchecker
mainchecker.check_for_main()
image_class = 'img-fluid item-comic-image' # the class used to find the picture element
one_day = datetime.timedelta(days=1) # one day
| en | 0.742196 | # the class used to find the picture element # one day | 1.9409 | 2 |
env/Lib/site-packages/notifypy/os_notifiers/windows.py | JFEscobarM/Proyecto_final | 149 | 6631825 | <filename>env/Lib/site-packages/notifypy/os_notifiers/windows.py
import pathlib
import os
import subprocess
from xml.etree import ElementTree
import tempfile
import uuid
import codecs
from loguru import logger
from ._base import BaseNotifier
class WindowsNotifier(BaseNotifier):
def __init__(self):
"""Mai... | <filename>env/Lib/site-packages/notifypy/os_notifiers/windows.py
import pathlib
import os
import subprocess
from xml.etree import ElementTree
import tempfile
import uuid
import codecs
from loguru import logger
from ._base import BaseNotifier
class WindowsNotifier(BaseNotifier):
def __init__(self):
"""Mai... | en | 0.670376 | Main Notification System for Windows. Basically ported from go-toast/toast # Create the base [Windows.UI.Notifications.ToastNotificationManager, Windows.UI.Notifications, ContentType = WindowsRuntime] | Out-Null [Windows.UI.Notifications.ToastNotification, Windows.UI.Notifications, ContentType = WindowsRuntime] | Out-N... | 2.096441 | 2 |
chartify/_core/radar_chart.py | vh920/chartify | 1 | 6631826 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2017-2018 Spotify AB
#
# 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... | # -*- coding: utf-8 -*-
#
# Copyright (c) 2017-2018 Spotify AB
#
# 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... | en | 0.614686 | # -*- coding: utf-8 -*- # # Copyright (c) 2017-2018 Spotify AB # # 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... | 2.693758 | 3 |
production_app.py | JoMingyu/Flask-Server-Quickstart | 122 | 6631827 | <filename>production_app.py
import os
from app import create_app
from config.app_config import ProductionLevelConfig
from config.db_config import RemoteDBConfig
if "SECRET_KEY" not in os.environ:
raise Warning("The secret key must be passed by the <SECRET_KEY> envvar.")
application = create_app(ProductionLevelCo... | <filename>production_app.py
import os
from app import create_app
from config.app_config import ProductionLevelConfig
from config.db_config import RemoteDBConfig
if "SECRET_KEY" not in os.environ:
raise Warning("The secret key must be passed by the <SECRET_KEY> envvar.")
application = create_app(ProductionLevelCo... | none | 1 | 1.796126 | 2 | |
data/GUM/CONLL-format/utils/webAnnotsv_to_conll.py | ToshihikoSakai/entity-recognition-datasets | 1,134 | 6631828 | <gh_stars>1000+
"""
This script can be used to convert Webanno .tsv files to CONLL.
For use with Python 2.
"""
import os
filename = 'GUM_whow_skittles.tsv'
# column indices that we need to know
word_ind = 2
iob_ind = 3
CONLLDIR_BASE = '../data_CONLL-format/'
rootDir_BASE = '../data_orig/gum/coref/tsv/'
def recur... | """
This script can be used to convert Webanno .tsv files to CONLL.
For use with Python 2.
"""
import os
filename = 'GUM_whow_skittles.tsv'
# column indices that we need to know
word_ind = 2
iob_ind = 3
CONLLDIR_BASE = '../data_CONLL-format/'
rootDir_BASE = '../data_orig/gum/coref/tsv/'
def recursively():
""... | en | 0.815888 | This script can be used to convert Webanno .tsv files to CONLL. For use with Python 2. # column indices that we need to know This converts every tsv file in the rootDir_BASE to CONLL-format and saves it in the CONLLDIR_BASE directory. #CONLLDIR is the directory where the new files should be written. # Parse the fil... | 3.227476 | 3 |
panda/python/serial.py | BoneE562/openpilot | 114 | 6631829 | <filename>panda/python/serial.py
# mimic a python serial port
class PandaSerial(object):
def __init__(self, panda, port, baud):
self.panda = panda
self.port = port
self.panda.set_uart_parity(self.port, 0)
self.panda.set_uart_baud(self.port, baud)
self.buf = b""
def read(self, l=1):
tt = sel... | <filename>panda/python/serial.py
# mimic a python serial port
class PandaSerial(object):
def __init__(self, panda, port, baud):
self.panda = panda
self.port = port
self.panda.set_uart_parity(self.port, 0)
self.panda.set_uart_baud(self.port, baud)
self.buf = b""
def read(self, l=1):
tt = sel... | en | 0.145214 | # mimic a python serial port #print "R: ", tt.encode("hex") #print "W: ", dat.encode("hex") #print ' pigeon_send("' + ''.join(map(lambda x: "\\x%02X" % ord(x), dat)) + '");' | 3.233653 | 3 |
task_1a_part2.py | MOLOCH-dev/EYANTRA1631_NIRIKSHAK | 0 | 6631830 | '''
*****************************************************************************************
*
* ===============================================
* Nirikshak Bot (NB) Theme (eYRC 2020-21)
* ===============================================
*
* This script is to implement Tas... | '''
*****************************************************************************************
*
* ===============================================
* Nirikshak Bot (NB) Theme (eYRC 2020-21)
* ===============================================
*
* This script is to implement Tas... | en | 0.687495 | ***************************************************************************************** * * =============================================== * Nirikshak Bot (NB) Theme (eYRC 2020-21) * =============================================== * * This script is to implement Task 1A... | 1.872382 | 2 |
pj.py | Iamnilaoba/pojian | 2 | 6631831 | <reponame>Iamnilaoba/pojian
from exts import db,mail
import config
from apps.cms.urls import bp as cms_bp
from apps.front.urls import bp as front_bp
from apps.common.urls import bp as common_bp
from flask_wtf import CSRFProtect
from flask import Flask,send_from_directory
from flask import request,url_for
from flask imp... | from exts import db,mail
import config
from apps.cms.urls import bp as cms_bp
from apps.front.urls import bp as front_bp
from apps.common.urls import bp as common_bp
from flask_wtf import CSRFProtect
from flask import Flask,send_from_directory
from flask import request,url_for
from flask import jsonify
import os
import... | zh | 0.989493 | #告诉主程序要映射数据库了 #下面这些所有代码是关于在富文本编辑器中上传照片用的 # 上传到本地服务器的路径 # 是否上传到七牛云 # 标记是受csrf保护的 # 生成文件的名字 # 注册过滤器 # 2018-10-12 12:12:12 | 2.138436 | 2 |
tests/test_connectors_darshan.py | NERSC/pytokio | 22 | 6631832 | <reponame>NERSC/pytokio
#!/usr/bin/env python
"""
Test the Darshan connector
"""
import tokiotest
import tokio.connectors.darshan
def verify_darshan(darshan_data):
"""
Verify that all components of a Darshan object are defined
"""
assert darshan_data is not None
# Make sure mount table parsing wor... | #!/usr/bin/env python
"""
Test the Darshan connector
"""
import tokiotest
import tokio.connectors.darshan
def verify_darshan(darshan_data):
"""
Verify that all components of a Darshan object are defined
"""
assert darshan_data is not None
# Make sure mount table parsing works
assert 'mounts' i... | en | 0.931883 | #!/usr/bin/env python Test the Darshan connector Verify that all components of a Darshan object are defined # Make sure mount table parsing works # Make sure header parsing works # Ensure that counters were found # Ensure the POSIX module and files were found (it should always be present) Verify that the base counters ... | 2.412396 | 2 |
include/camera_driver/camera_driver.py | lanfis/Camera_Controler | 0 | 6631833 | <reponame>lanfis/Camera_Controler
#!/usr/bin/env python
# license removed for brevity
import time
import os
import sys
sys.path.append(os.path.expanduser("~"))
current_folder = os.path.dirname(os.path.realpath(__file__))
include_folder = os.path.abspath(current_folder + "/../../include")
sys.path.append(current_folder)... | #!/usr/bin/env python
# license removed for brevity
import time
import os
import sys
sys.path.append(os.path.expanduser("~"))
current_folder = os.path.dirname(os.path.realpath(__file__))
include_folder = os.path.abspath(current_folder + "/../../include")
sys.path.append(current_folder)
sys.path.append(include_folder)
s... | en | 0.578293 | #!/usr/bin/env python # license removed for brevity ##PUBLIC: ##PRIVATE: self.image_folder, self.image_name = self.camera_handler.capture_image() path = os.path.join(self.image_folder, self.image_name) | 2.438694 | 2 |
libraries/alerts/api/serializers.py | cca/libraries_wagtail | 9 | 6631834 | from rest_framework import serializers
from alerts.models import Alert
class AlertSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Alert
fields = ['id', 'url', 'last_published_at', 'alert_text', 'alert_link', 'alert_link_text', ]
| from rest_framework import serializers
from alerts.models import Alert
class AlertSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Alert
fields = ['id', 'url', 'last_published_at', 'alert_text', 'alert_link', 'alert_link_text', ]
| none | 1 | 2.113174 | 2 | |
compago_plugins/__init__.py | civitaslearning/compago | 0 | 6631835 | from logging_plugin import LoggingPlugin
from config_plugin import ConfigPlugin
| from logging_plugin import LoggingPlugin
from config_plugin import ConfigPlugin
| none | 1 | 1.110951 | 1 | |
stsc.py | miaocheng/STSC | 0 | 6631836 | <reponame>miaocheng/STSC
# &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
# stsc.py
#
# This python file contains the definition of self-tuning spectral clustering method.
# Reference:
# <NAME> and <NAME>, Self-Tuning Spectral Clustering, in Proc. N... | # &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
# stsc.py
#
# This python file contains the definition of self-tuning spectral clustering method.
# Reference:
# <NAME> and <NAME>, Self-Tuning Spectral Clustering, in Proc. Neural
# Information Pro... | pt | 0.384214 | # &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& # stsc.py # # This python file contains the definition of self-tuning spectral clustering method. # Reference: # <NAME> and <NAME>, Self-Tuning Spectral Clustering, in Proc. Neural # Information Processing ... | 2.537294 | 3 |
examples/ilya/tail_scaling02.py | radiasoft/rsdynfric | 0 | 6631837 | <reponame>radiasoft/rsdynfric<gh_stars>0
import numpy as np
import matplotlib.pyplot as plt
D, F, DF = np.loadtxt("D_Fintegr_DtimesFintegr.txt", skiprows=0 , unpack=True)
n_e = 2.0e+15
dD = D[2]-D[1] #4.923725109213487e-07 # r1
#print n_e *2. *np.pi *dD *np.sum(DF)
plt.plot(D[-6:D.size], np.log( -DF[-6:D.size]... | import numpy as np
import matplotlib.pyplot as plt
D, F, DF = np.loadtxt("D_Fintegr_DtimesFintegr.txt", skiprows=0 , unpack=True)
n_e = 2.0e+15
dD = D[2]-D[1] #4.923725109213487e-07 # r1
#print n_e *2. *np.pi *dD *np.sum(DF)
plt.plot(D[-6:D.size], np.log( -DF[-6:D.size] ), 'ro')
plt.xlabel('D (m)')
plt.ylabel(... | en | 0.289637 | #4.923725109213487e-07 # r1 #print n_e *2. *np.pi *dD *np.sum(DF) #plt.savefig('DtimesFintegr_tail_scaling.pdf') #r = -(np.log(-DF[-1]) -np.log(-DF[-10])) / (D[-1] -D[-10]) | 2.342899 | 2 |
book_api/tests/test_views_books.py | musflood/zonar-book-api | 0 | 6631838 | <reponame>musflood/zonar-book-api
"""Unit tests for the Book view functions."""
import pytest
from pyramid.httpexceptions import HTTPBadRequest, HTTPForbidden
from book_api.models.book import Book
from book_api.tests.conftest import FAKE
from book_api.views.books import (
_create_book, _delete_book, _list_books, ... | """Unit tests for the Book view functions."""
import pytest
from pyramid.httpexceptions import HTTPBadRequest, HTTPForbidden
from book_api.models.book import Book
from book_api.tests.conftest import FAKE
from book_api.views.books import (
_create_book, _delete_book, _list_books, _update_book, validate_user)
def... | en | 0.715065 | Unit tests for the Book view functions. Test that validate_user raises HTTPBadRequest for missing password. Test that validate_user raises HTTPForbidden for bad email. Test that validate_user raises HTTPForbidden for bad email. Test that validate_user raises HTTPForbidden for bad email. Test that list returns empty lis... | 2.757668 | 3 |
snoop/data/migrations/0033_auto_20200512_0911.py | liquidinvestigations/hoover-snoop2 | 0 | 6631839 | <gh_stars>0
# Generated by Django 3.0.4 on 2020-05-12 09:11
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('data', '0032_remove_ocrsource_root'),
]
operations = [
migrations.AlterField(
model_name='ocrsource',
na... | # Generated by Django 3.0.4 on 2020-05-12 09:11
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('data', '0032_remove_ocrsource_root'),
]
operations = [
migrations.AlterField(
model_name='ocrsource',
name='name',
... | en | 0.821412 | # Generated by Django 3.0.4 on 2020-05-12 09:11 | 1.582688 | 2 |
eparted/src/eparted.py | builder08/enigma2-plugins_2 | 0 | 6631840 | <gh_stars>0
# -*- coding: utf-8 -*-
# code by GeminiTeam
from __future__ import print_function
from enigma import eTimer
from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from Components.Label import Label
from Components.Pixmap import MultiPixmap
from Components.Sources.StaticText import S... | # -*- coding: utf-8 -*-
# code by GeminiTeam
from __future__ import print_function
from enigma import eTimer
from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from Components.Label import Label
from Components.Pixmap import MultiPixmap
from Components.Sources.StaticText import StaticText
fr... | en | 0.204013 | # -*- coding: utf-8 -*- # code by GeminiTeam #from Plugins.Bp.geminimain.gTools import cleanexit #----------------------------------------------------------------------------- #Einheit abschneiden #if x=="BYT;":#start #end #Part #Device #----------------------------------------------------------------------------------... | 1.810643 | 2 |
app/views/__init__.py | FSU-ACM/Contest-Server | 8 | 6631841 | <gh_stars>1-10
# app.views
from flask import render_template
from flask.views import View
from app import app
from app.models import Team
class IndexView(View):
"""Main index view
"""
def dispatch_request(self):
return render_template('index/index.html')
class TeamListView(View):
"""View l... | # app.views
from flask import render_template
from flask.views import View
from app import app
from app.models import Team
class IndexView(View):
"""Main index view
"""
def dispatch_request(self):
return render_template('index/index.html')
class TeamListView(View):
"""View listing all regi... | en | 0.887906 | # app.views Main index view View listing all registered teams Prepares list of valid teams, counts number of participants, and renders the template. # A team is only valid if: # 1. teamname is a valid property (exists) and not empty # 2. There is at least one member # 3. It has an assigned division | 2.652263 | 3 |
Strings/929. Unique Email Addresses.py | thewires2/Leetcode | 1 | 6631842 | class Solution:
def numUniqueEmails(self, emails: List[str]) -> int:
d=[]
for i in emails:
x,y=i.split("@")
if "+" in x:
x=x[:x.index("+")]
x=x.replace(".","")
d.append(x+"@"+y)
return len(set(d))
| class Solution:
def numUniqueEmails(self, emails: List[str]) -> int:
d=[]
for i in emails:
x,y=i.split("@")
if "+" in x:
x=x[:x.index("+")]
x=x.replace(".","")
d.append(x+"@"+y)
return len(set(d))
| none | 1 | 3.057019 | 3 | |
cogs/commands/welcome.py | noahdm4321/GWU-Bot | 0 | 6631843 | import random
from discord.ext import commands
from database import data
class WelcomeMessage(commands.Cog, name='Welcome Message'):
def __init__(self, client):
self.client = client
self.channel = client.get_guild(879009710701957130).get_channel(879009714069962843)
print('welcome online!')
## Sends user we... | import random
from discord.ext import commands
from database import data
class WelcomeMessage(commands.Cog, name='Welcome Message'):
def __init__(self, client):
self.client = client
self.channel = client.get_guild(879009710701957130).get_channel(879009714069962843)
print('welcome online!')
## Sends user we... | en | 0.755084 | ## Sends user welcome message ## #797318280826191922>. New to Discord? Check out our <#875232316010668082>.\nIf you still have questions about the Guid Wars 2 or Discord, you can ask in <#736254186353721454>.\nWe have events scheduled in our <#852189307031781426>. Be sure to you have the correct <#735989626455457894> t... | 3.212066 | 3 |
azurelinuxagent/ga/update.py | TeamDev-it/WALinuxAgent | 0 | 6631844 | # Windows Azure Linux Agent
#
# Copyright 2018 Microsoft Corporation
#
# 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 ... | # Windows Azure Linux Agent
#
# Copyright 2018 Microsoft Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | en | 0.798626 | # Windows Azure Linux Agent # # Copyright 2018 Microsoft Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ... | 1.428438 | 1 |
Experimenter/Experiments/script/timesetgrating.py | chrox/RealTimeElectrophy | 4 | 6631845 | <filename>Experimenter/Experiments/script/timesetgrating.py
# Generate arbitrary onset and offset timing gratings.
#
# Copyright (C) 2010-2011 <NAME>
#
# See LICENSE.TXT that came with this file.
from __future__ import division
from StimControl.LightStim.SweepSeque import TimingSeque
from StimControl.LightStim.LightDa... | <filename>Experimenter/Experiments/script/timesetgrating.py
# Generate arbitrary onset and offset timing gratings.
#
# Copyright (C) 2010-2011 <NAME>
#
# See LICENSE.TXT that came with this file.
from __future__ import division
from StimControl.LightStim.SweepSeque import TimingSeque
from StimControl.LightStim.LightDa... | en | 0.816131 | # Generate arbitrary onset and offset timing gratings. # # Copyright (C) 2010-2011 <NAME> # # See LICENSE.TXT that came with this file. | 2.18213 | 2 |
boardStateDriver/boardFunc/resetBoard.py | terpyPy/ButtonBox | 0 | 6631846 | def resetBoard(theBoard):
# get a copy of the board to modify and return
newBoard = theBoard
for boardIndex, val in enumerate(newBoard): # enumerate gets the index and the value for each iteration of loop
# if the value of boardIndex is not 0 turn it off
if val != 0:
newBoard[b... | def resetBoard(theBoard):
# get a copy of the board to modify and return
newBoard = theBoard
for boardIndex, val in enumerate(newBoard): # enumerate gets the index and the value for each iteration of loop
# if the value of boardIndex is not 0 turn it off
if val != 0:
newBoard[b... | en | 0.660075 | # get a copy of the board to modify and return # enumerate gets the index and the value for each iteration of loop # if the value of boardIndex is not 0 turn it off # else dont reset value, skip it # return the Board modified copy | 3.482903 | 3 |
Self-Consistent-Field/SOUHF.py | andyj10224/psi4numpy | 214 | 6631847 | <filename>Self-Consistent-Field/SOUHF.py
"""
Unrestricted open-shell Hartree-Fock using direct second-order
convergence acceleration.
References:
- UHF equations & algorithm from [Szabo:1996]
- SO equations & algorithm from [Helgaker:2000]
"""
__authors__ = "<NAME>"
__credits__ = ["<NAME>"]
__copyright__ = "(c) 2014... | <filename>Self-Consistent-Field/SOUHF.py
"""
Unrestricted open-shell Hartree-Fock using direct second-order
convergence acceleration.
References:
- UHF equations & algorithm from [Szabo:1996]
- SO equations & algorithm from [Helgaker:2000]
"""
__authors__ = "<NAME>"
__credits__ = ["<NAME>"]
__copyright__ = "(c) 2014... | en | 0.650744 | Unrestricted open-shell Hartree-Fock using direct second-order convergence acceleration. References: - UHF equations & algorithm from [Szabo:1996] - SO equations & algorithm from [Helgaker:2000] # Set Psi4 memory and output options # Triplet oxygen 0 3 O O 1 1.2 symmetry c1 # Set defaults # Integral generation... | 1.980783 | 2 |
tests/test_storages.py | climbus/chkapi | 0 | 6631848 | <filename>tests/test_storages.py
import os
import tempfile
import pytest
from chkapi.storages import STORAGE_FILE_NAME, TempFileStorage
@pytest.fixture(autouse=True)
def set_tmpdir(tmp_path):
tempfile.tempdir = None
os.environ["TMPDIR"] = str(tmp_path)
@pytest.mark.asyncio
async def test_save_url(tmp_path... | <filename>tests/test_storages.py
import os
import tempfile
import pytest
from chkapi.storages import STORAGE_FILE_NAME, TempFileStorage
@pytest.fixture(autouse=True)
def set_tmpdir(tmp_path):
tempfile.tempdir = None
os.environ["TMPDIR"] = str(tmp_path)
@pytest.mark.asyncio
async def test_save_url(tmp_path... | none | 1 | 2.401153 | 2 | |
certbot-nginx/certbot_nginx/tests/tls_sni_01_test.py | tsrivishnu/certbot | 1 | 6631849 | <filename>certbot-nginx/certbot_nginx/tests/tls_sni_01_test.py
"""Tests for certbot_nginx.tls_sni_01"""
import unittest
import shutil
import mock
import six
from acme import challenges
from certbot import achallenges
from certbot import errors
from certbot.plugins import common_test
from certbot.tests import acme_u... | <filename>certbot-nginx/certbot_nginx/tests/tls_sni_01_test.py
"""Tests for certbot_nginx.tls_sni_01"""
import unittest
import shutil
import mock
import six
from acme import challenges
from certbot import achallenges
from certbot import errors
from certbot.plugins import common_test
from certbot.tests import acme_u... | en | 0.512874 | Tests for certbot_nginx.tls_sni_01 Test the NginxTlsSni01 challenge. # pylint: disable=protected-access # Make sure challenge config is included in main config # pylint: disable=protected-access # pylint: disable=protected-access # pylint: disable=protected-access # pragma: no cover | 2.248626 | 2 |
Dynamic_Programming/Decibinary_Numbers.py | NikolayVaklinov10/Interview_Preparation_Kit | 0 | 6631850 | <gh_stars>0
import os
from collections import defaultdict
from bisect import bisect_right
MAX_NUMBERS = 285113
MAX_ITER = 10
MAX_DIGIT = 19
def get_dec(x):
result, i = 0, 0
while x > 0:
result += (x % 10) * 2 ** i
x, i = x // 10, i + 1
return result
def get_matrix(d, j, positions):
... | import os
from collections import defaultdict
from bisect import bisect_right
MAX_NUMBERS = 285113
MAX_ITER = 10
MAX_DIGIT = 19
def get_dec(x):
result, i = 0, 0
while x > 0:
result += (x % 10) * 2 ** i
x, i = x // 10, i + 1
return result
def get_matrix(d, j, positions):
i_for_sum, m... | none | 1 | 2.792154 | 3 |