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 |
|---|---|---|---|---|---|---|---|---|---|---|
dashboard_analytics/tasks/transaction_processor.py | Astewart1510/pvt-algoranddashboard | 0 | 6800 | <filename>dashboard_analytics/tasks/transaction_processor.py
from dashboard_analytics.models import AccountType, InstrumentType, Account, Transaction
def process_json_transactions(transactions):
for txn in transactions:
print(txn["pk"]) | <filename>dashboard_analytics/tasks/transaction_processor.py
from dashboard_analytics.models import AccountType, InstrumentType, Account, Transaction
def process_json_transactions(transactions):
for txn in transactions:
print(txn["pk"]) | none | 1 | 2.080874 | 2 | |
MuonGun/resources/scripts/histreduce.py | hschwane/offline_production | 1 | 6801 | <reponame>hschwane/offline_production<filename>MuonGun/resources/scripts/histreduce.py
#!/usr/bin/env python
"""
Add all (potentially gigantic) histograms in a group of files.
"""
import dashi
import tables
import os, sys, operator, shutil
from optparse import OptionParser
parser = OptionParser(usage="%prog [OPTIONS... | #!/usr/bin/env python
"""
Add all (potentially gigantic) histograms in a group of files.
"""
import dashi
import tables
import os, sys, operator, shutil
from optparse import OptionParser
parser = OptionParser(usage="%prog [OPTIONS] infiles outfile", description=__doc__)
parser.add_option("--blocksize", dest="blocksi... | en | 0.694533 | #!/usr/bin/env python Add all (potentially gigantic) histograms in a group of files. # a dashi histogram Add dashi histograms stored in HDF5 groups :param blocksize: operate on blocksize I/O chunks at a time | 2.653539 | 3 |
procrastinate/exceptions.py | ignaciocabeza/procrastinate | 0 | 6802 | <filename>procrastinate/exceptions.py
import datetime
class ProcrastinateException(Exception):
"""
Unexpected Procrastinate error.
"""
def __init__(self, message=None):
if not message:
message = self.__doc__
super().__init__(message)
class TaskNotFound(ProcrastinateExcep... | <filename>procrastinate/exceptions.py
import datetime
class ProcrastinateException(Exception):
"""
Unexpected Procrastinate error.
"""
def __init__(self, message=None):
if not message:
message = self.__doc__
super().__init__(message)
class TaskNotFound(ProcrastinateExcep... | en | 0.859435 | Unexpected Procrastinate error. Task cannot be imported. Job ended with an exception. App was not found at the provided path, or the loaded object is not an App. Job should be retried. App was not open. Procrastinate App needs to be opened using: - ``app.open()``, - ``await app.open_async()``, - ``with app... | 2.969168 | 3 |
config/settings/local.py | vyshakTs/STORE_MANAGEMENT_SYSTEM | 0 | 6803 | from .base import *
DEBUG = True
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'SMS',
'USER': 'postgres',
'PASSWORD': 'password',
'HOST': 'localhost',
'PORT': '',
}... | from .base import *
DEBUG = True
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'SMS',
'USER': 'postgres',
'PASSWORD': 'password',
'HOST': 'localhost',
'PORT': '',
}... | en | 0.264818 | # Loads SECRET_KEY from .env file # SECRET_KEY = get_env_variable('SECRET_KEY') | 1.515534 | 2 |
question3.py | haojunsng/foodpanda-dataeng | 0 | 6804 | from functions import get_df, write_df
import geopy
from geopy import distance
"""
The function question3 takes in the latitude and longitude of potential distress locations,
and returns the nearest port with essential provisions such as water, fuel_oil and diesel.
"""
def question3(dataset_name, latitude, longitude)... | from functions import get_df, write_df
import geopy
from geopy import distance
"""
The function question3 takes in the latitude and longitude of potential distress locations,
and returns the nearest port with essential provisions such as water, fuel_oil and diesel.
"""
def question3(dataset_name, latitude, longitude)... | en | 0.798799 | The function question3 takes in the latitude and longitude of potential distress locations, and returns the nearest port with essential provisions such as water, fuel_oil and diesel. | 3.67135 | 4 |
plugins/aea-cli-benchmark/aea_cli_benchmark/case_acn_communication/case.py | valory-xyz/agents-aea | 0 | 6805 | <reponame>valory-xyz/agents-aea<filename>plugins/aea-cli-benchmark/aea_cli_benchmark/case_acn_communication/case.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2022 <NAME>
# Copyright 2018-2021 Fetch.AI Limited
#
# L... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2022 <NAME>
# Copyright 2018-2021 Fetch.AI Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance wi... | en | 0.734076 | #!/usr/bin/env python3 # -*- coding: utf-8 -*- # ------------------------------------------------------------------------------ # # Copyright 2022 <NAME> # Copyright 2018-2021 Fetch.AI Limited # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance wi... | 1.609848 | 2 |
examples/pybullet/vr_kuka_setup.py | q4a/bullet3 | 12 | 6806 | import pybullet as p
#p.connect(p.UDP,"192.168.86.100")
p.connect(p.SHARED_MEMORY)
p.resetSimulation()
objects = [p.loadURDF("plane.urdf", 0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,1.000000)]
objects = [p.loadURDF("samurai.urdf", 0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,1.000000)]
objects = [p... | import pybullet as p
#p.connect(p.UDP,"192.168.86.100")
p.connect(p.SHARED_MEMORY)
p.resetSimulation()
objects = [p.loadURDF("plane.urdf", 0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,1.000000)]
objects = [p.loadURDF("samurai.urdf", 0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,1.000000)]
objects = [p... | en | 0.358916 | #p.connect(p.UDP,"192.168.86.100") | 2.210022 | 2 |
genomics_algo/utilities/string_cmp.py | SvoONs/genomics_algo | 0 | 6807 | <filename>genomics_algo/utilities/string_cmp.py<gh_stars>0
def longest_common_prefix(s1: str, s2: str) -> str:
"""
Finds the longest common prefix (substring) given two strings
s1: First string to compare
s2: Second string to compare
Returns:
Longest common prefix between s1 and s2
>>... | <filename>genomics_algo/utilities/string_cmp.py<gh_stars>0
def longest_common_prefix(s1: str, s2: str) -> str:
"""
Finds the longest common prefix (substring) given two strings
s1: First string to compare
s2: Second string to compare
Returns:
Longest common prefix between s1 and s2
>>... | en | 0.546677 | Finds the longest common prefix (substring) given two strings s1: First string to compare s2: Second string to compare Returns: Longest common prefix between s1 and s2 >>> longest_common_prefix("ACTA", "GCCT") '' >>> longest_common_prefix("ACTA", "ACT") 'ACT' >>> longest_commo... | 3.49077 | 3 |
whyqd/parsers/wrangling_parser.py | whythawk/whyqd | 17 | 6808 | from __future__ import annotations
from typing import Optional, Dict, List, Union, Type, TYPE_CHECKING
from datetime import date, datetime
import pandas as pd
import numpy as np
import re
import locale
try:
locale.setlocale(locale.LC_ALL, "en_US.UTF-8")
except locale.Error:
# Readthedocs has a problem, but dif... | from __future__ import annotations
from typing import Optional, Dict, List, Union, Type, TYPE_CHECKING
from datetime import date, datetime
import pandas as pd
import numpy as np
import re
import locale
try:
locale.setlocale(locale.LC_ALL, "en_US.UTF-8")
except locale.Error:
# Readthedocs has a problem, but dif... | en | 0.580638 | # Readthedocs has a problem, but difficult to replicate Get, review and restructure tabular data. Return a Pandas dataframe from a given source. Accepts default pandas parameters for Excel and CSV, but the objective is to preserve the source data with little data conversion outside of the data wranglin... | 2.269094 | 2 |
0x02-python-import_modules/2-args.py | FatChicken277/holbertonschool-higher_level_programming | 0 | 6809 | #!/usr/bin/python3
def args(args):
lenn = len(args) - 1
if lenn == 0:
print("0 arguments.")
elif lenn == 1:
print("{0} argument:".format(lenn))
print("{0}: {1}".format(lenn, args[lenn]))
elif lenn > 1:
print("{0} arguments:".format(lenn))
for i in range(lenn):
... | #!/usr/bin/python3
def args(args):
lenn = len(args) - 1
if lenn == 0:
print("0 arguments.")
elif lenn == 1:
print("{0} argument:".format(lenn))
print("{0}: {1}".format(lenn, args[lenn]))
elif lenn > 1:
print("{0} arguments:".format(lenn))
for i in range(lenn):
... | fr | 0.386793 | #!/usr/bin/python3 | 3.864326 | 4 |
taurex/data/profiles/__init__.py | rychallener/TauREx3_public | 10 | 6810 | """
These modules contain sub-modules related to defining various profiles in a model
""" | """
These modules contain sub-modules related to defining various profiles in a model
""" | en | 0.697126 | These modules contain sub-modules related to defining various profiles in a model | 1.129603 | 1 |
day-2/part_b.py | yuetsin/AoC | 0 | 6811 | <gh_stars>0
#!/usr/bin/env python3
import re
def get_input() -> list:
with open('./input', 'r') as f:
return [v for v in [v.strip() for v in f.readlines()] if v]
lines = get_input()
count = 0
for line in lines:
lower, upper, char, password = re.split(r'-|: | ', line)
lower, upper = int(lower) ... | #!/usr/bin/env python3
import re
def get_input() -> list:
with open('./input', 'r') as f:
return [v for v in [v.strip() for v in f.readlines()] if v]
lines = get_input()
count = 0
for line in lines:
lower, upper, char, password = re.split(r'-|: | ', line)
lower, upper = int(lower) - 1, int(upp... | en | 0.841637 | #!/usr/bin/env python3 # don't care about boundaries | 3.526417 | 4 |
src/tone.py | devanshslnk/HelpOff | 2 | 6812 | from __future__ import print_function
import json
from os.path import join, dirname
from watson_developer_cloud import ToneAnalyzerV3
from watson_developer_cloud.tone_analyzer_v3 import ToneInput
from pprint import pprint
# If service instance provides API key authentication
# service = ToneAnalyzerV3(
# ## url i... | from __future__ import print_function
import json
from os.path import join, dirname
from watson_developer_cloud import ToneAnalyzerV3
from watson_developer_cloud.tone_analyzer_v3 import ToneInput
from pprint import pprint
# If service instance provides API key authentication
# service = ToneAnalyzerV3(
# ## url i... | en | 0.471315 | # If service instance provides API key authentication # service = ToneAnalyzerV3( # ## url is optional, and defaults to the URL below. Use the correct URL for your region. # url='https://gateway.watsonplatform.net/tone-analyzer/api', # version='2017-09-21', # iam_apikey='your_apikey') ## url is optional... | 2.153002 | 2 |
hcloud/servers/domain.py | usmannasir/hcloud-python | 1 | 6813 | <gh_stars>1-10
# -*- coding: utf-8 -*-
from hcloud.core.domain import BaseDomain
from hcloud.helpers.descriptors import ISODateTime
class Server(BaseDomain):
"""Server Domain
:param id: int
ID of the server
:param name: str
Name of the server (must be unique per project and a valid... | # -*- coding: utf-8 -*-
from hcloud.core.domain import BaseDomain
from hcloud.helpers.descriptors import ISODateTime
class Server(BaseDomain):
"""Server Domain
:param id: int
ID of the server
:param name: str
Name of the server (must be unique per project and a valid hostname as pe... | en | 0.581623 | # -*- coding: utf-8 -*- Server Domain :param id: int ID of the server :param name: str Name of the server (must be unique per project and a valid hostname as per RFC 1123) :param status: str Status of the server Choices: `running`, `initializing`, `starting`, `stopping`, `o... | 2.397794 | 2 |
AutomationFramework/tests/interfaces/test_if_subif.py | sbarguil/Testing-framework | 1 | 6814 | <reponame>sbarguil/Testing-framework<filename>AutomationFramework/tests/interfaces/test_if_subif.py
import pytest
from AutomationFramework.page_objects.interfaces.interfaces import Interfaces
from AutomationFramework.tests.base_test import BaseTest
class TestInterfacesSubInterfaces(BaseTest):
test_case_file = 'if... | import pytest
from AutomationFramework.page_objects.interfaces.interfaces import Interfaces
from AutomationFramework.tests.base_test import BaseTest
class TestInterfacesSubInterfaces(BaseTest):
test_case_file = 'if_subif.yml'
@pytest.mark.parametrize('create_page_object_arg', [{'test_case_file': test_case_fi... | none | 1 | 2.236737 | 2 | |
keystone/common/sql/migrate_repo/versions/001_add_initial_tables.py | sanket4373/keystone | 0 | 6815 | <reponame>sanket4373/keystone
# Copyright 2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | # Copyright 2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | en | 0.854342 | # Copyright 2012 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in... | 1.894283 | 2 |
boa3_test/examples/ico.py | DanPopa46/neo3-boa | 0 | 6816 | <gh_stars>0
from typing import Any, List, Union
from boa3.builtin import NeoMetadata, metadata, public
from boa3.builtin.contract import Nep17TransferEvent
from boa3.builtin.interop.blockchain import get_contract
from boa3.builtin.interop.contract import GAS, NEO, call_contract
from boa3.builtin.interop.runtime import... | from typing import Any, List, Union
from boa3.builtin import NeoMetadata, metadata, public
from boa3.builtin.contract import Nep17TransferEvent
from boa3.builtin.interop.blockchain import get_contract
from boa3.builtin.interop.contract import GAS, NEO, call_contract
from boa3.builtin.interop.runtime import calling_scr... | en | 0.819417 | # ------------------------------------------- # METADATA # ------------------------------------------- Defines this smart contract's metadata information # ------------------------------------------- # Storage Key Prefixes # ------------------------------------------- # ------------------------------------------- # TOK... | 1.569336 | 2 |
emotion_recognition.py | Partaourides/SERN | 10 | 6817 | import os
# Restrict the script to run on CPU
os.environ ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"] = ""
# Import Keras Tensoflow Backend
# from keras import backend as K
import tensorflow as tf
# Configure it to use only specific CPU Cores
config = tf.ConfigProto(intra_op_parallelism_thre... | import os
# Restrict the script to run on CPU
os.environ ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"] = ""
# Import Keras Tensoflow Backend
# from keras import backend as K
import tensorflow as tf
# Configure it to use only specific CPU Cores
config = tf.ConfigProto(intra_op_parallelism_thre... | de | 0.778486 | # Restrict the script to run on CPU # Import Keras Tensoflow Backend # from keras import backend as K # Configure it to use only specific CPU Cores # import tensorflow as tf ######################################################################################################################## # Hyper-parameters ######... | 2.167215 | 2 |
dashboard/rpc/alias.py | flaree/Toxic-Cogs | 0 | 6818 | <gh_stars>0
import discord
from redbot.core.bot import Red
from redbot.core.commands import commands
from redbot.core.utils.chat_formatting import humanize_list
from .utils import permcheck, rpccheck
class DashboardRPC_AliasCC:
def __init__(self, cog: commands.Cog):
self.bot: Red = cog.bot
... | import discord
from redbot.core.bot import Red
from redbot.core.commands import commands
from redbot.core.utils.chat_formatting import humanize_list
from .utils import permcheck, rpccheck
class DashboardRPC_AliasCC:
def __init__(self, cog: commands.Cog):
self.bot: Red = cog.bot
self.co... | en | 0.541431 | # Initialize RPC handlers | 2.137123 | 2 |
train.py | hafezgh/music_classification | 1 | 6819 | import torch
DEVICE = 'cuda'
import math
import torch.optim as optim
from model import *
import os
import copy, gzip, pickle, time
data_dir = './drive/MyDrive/music_classification/Data'
classes = os.listdir(data_dir+'/images_original')
def fit(model, train_loader, train_len, optimizer, criterion):
model.train()
... | import torch
DEVICE = 'cuda'
import math
import torch.optim as optim
from model import *
import os
import copy, gzip, pickle, time
data_dir = './drive/MyDrive/music_classification/Data'
classes = os.listdir(data_dir+'/images_original')
def fit(model, train_loader, train_len, optimizer, criterion):
model.train()
... | en | 0.493878 | #print('Batch Size:', batch_size,'Number of Batches:', n_batches) #prog_bar = tqdm(enumerate(train_loader), total=int(train_len/batch_size)) #prog_bar = tqdm(enumerate(val_loader), total=int(val_len/batch_size)) #Saving the model # Check early stopping condition ## Saving the model | 2.388278 | 2 |
dlk/core/schedulers/__init__.py | cstsunfu/dlkit | 0 | 6820 | <filename>dlk/core/schedulers/__init__.py
# Copyright 2021 cstsunfu. 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
#
... | <filename>dlk/core/schedulers/__init__.py
# Copyright 2021 cstsunfu. 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
#
... | en | 0.804528 | # Copyright 2021 cstsunfu. 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.380841 | 2 |
doc/samples/pos.py | m4ta1l/doit | 1,390 | 6821 | def task_pos_args():
def show_params(param1, pos):
print('param1 is: {0}'.format(param1))
for index, pos_arg in enumerate(pos):
print('positional-{0}: {1}'.format(index, pos_arg))
return {'actions':[(show_params,)],
'params':[{'name':'param1',
'shor... | def task_pos_args():
def show_params(param1, pos):
print('param1 is: {0}'.format(param1))
for index, pos_arg in enumerate(pos):
print('positional-{0}: {1}'.format(index, pos_arg))
return {'actions':[(show_params,)],
'params':[{'name':'param1',
'shor... | none | 1 | 2.664534 | 3 | |
projectq/backends/_qracksim/_simulator_test.py | vm6502q/ProjectQ | 1 | 6822 | # Copyright 2017 ProjectQ-Framework (www.projectq.ch)
#
# 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 app... | # Copyright 2017 ProjectQ-Framework (www.projectq.ch)
#
# 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 app... | en | 0.871547 | # Copyright 2017 ProjectQ-Framework (www.projectq.ch) # # 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 app... | 1.705822 | 2 |
app/deps.py | jshwi/jss | 1 | 6823 | <reponame>jshwi/jss<filename>app/deps.py<gh_stars>1-10
"""
app.deps
========
Register dependencies that are not part of a ``Flask`` extension.
"""
from flask import Flask
from redis import Redis
from rq import Queue
def init_app(app: Flask) -> None:
"""Register application helpers that are not ``Flask-`` extensi... | """
app.deps
========
Register dependencies that are not part of a ``Flask`` extension.
"""
from flask import Flask
from redis import Redis
from rq import Queue
def init_app(app: Flask) -> None:
"""Register application helpers that are not ``Flask-`` extensions.
As these are not ``Flask`` extensions they do... | en | 0.864118 | app.deps ======== Register dependencies that are not part of a ``Flask`` extension. Register application helpers that are not ``Flask-`` extensions. As these are not ``Flask`` extensions they do not have an ``init_app`` method, and so can be attached to the app by declaring them as instance attributes. ... | 2.005224 | 2 |
uncertainty/util/__init__.py | sangdon/intern2020_cocal | 0 | 6824 | from util.args import *
from util.logger import Logger
| from util.args import *
from util.logger import Logger
| none | 1 | 1.172455 | 1 | |
com_reader.py | plusterm/plusterm | 2 | 6825 | # from wx.lib.pubsub import pub
from pubsub import pub
import serial
import threading
import queue
import time
class ComReaderThread(threading.Thread):
'''
Creates a thread that continously reads from the serial connection
Puts result as a tuple (timestamp, data) in a queue
'''
def __init__(self... | # from wx.lib.pubsub import pub
from pubsub import pub
import serial
import threading
import queue
import time
class ComReaderThread(threading.Thread):
'''
Creates a thread that continously reads from the serial connection
Puts result as a tuple (timestamp, data) in a queue
'''
def __init__(self... | en | 0.920968 | # from wx.lib.pubsub import pub Creates a thread that continously reads from the serial connection Puts result as a tuple (timestamp, data) in a queue # if ser still thinks it's open close it # if reconnection failed let some time pass | 2.876546 | 3 |
docker/app/app.py | ganeshkumarsv/datadog-cloudfoundry-buildpack | 5 | 6826 | <reponame>ganeshkumarsv/datadog-cloudfoundry-buildpack
from flask import Flask
from datadog import statsd
import logging
import os
# This is a small example application
# It uses tracing and dogstatsd on a sample flask application
log = logging.getLogger("app")
app = Flask(__name__)
# The app has two routes, a bas... | from flask import Flask
from datadog import statsd
import logging
import os
# This is a small example application
# It uses tracing and dogstatsd on a sample flask application
log = logging.getLogger("app")
app = Flask(__name__)
# The app has two routes, a basic endpoint and an exception endpoint
@app.route("/")
d... | en | 0.912556 | # This is a small example application # It uses tracing and dogstatsd on a sample flask application # The app has two routes, a basic endpoint and an exception endpoint # This is meant to be run directly, instead of executed through flask run # It grabs the host and port from the environment | 2.835177 | 3 |
Data Structure using Python/Linked_List/2linked_list1.py | shubhamsah/OpenEDU | 1 | 6827 | # Lets create a linked list that has the following elements
'''
1. FE
2. SE
3. TE
4. BE
'''
# Creating a Node class to create individual Nodes
class Node:
def __init__(self,data):
self.__data = data
self.__next = None
def get_data(self):
return self.__data
... | # Lets create a linked list that has the following elements
'''
1. FE
2. SE
3. TE
4. BE
'''
# Creating a Node class to create individual Nodes
class Node:
def __init__(self,data):
self.__data = data
self.__next = None
def get_data(self):
return self.__data
... | en | 0.653725 | # Lets create a linked list that has the following elements 1. FE
2. SE
3. TE
4. BE # Creating a Node class to create individual Nodes # ADDING ELEMENT IN THE LINKED LIST | 3.946992 | 4 |
monai/networks/blocks/selfattention.py | function2-llx/MONAI | 1 | 6828 | <gh_stars>1-10
# Copyright (c) MONAI Consortium
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to... | # Copyright (c) MONAI Consortium
# 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, so... | en | 0.833159 | # Copyright (c) MONAI Consortium # 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, so... | 2.28679 | 2 |
api/tests/opentrons/commands/test_protocol_commands.py | mrakitin/opentrons | 0 | 6829 | <reponame>mrakitin/opentrons
import pytest
from opentrons.commands import protocol_commands
@pytest.mark.parametrize(
argnames="seconds,"
"minutes,"
"expected_seconds,"
"expected_minutes,"
"expected_text",
argvalues=[
[10, 0, 10, 0, "Delaying for 0 m... | import pytest
from opentrons.commands import protocol_commands
@pytest.mark.parametrize(
argnames="seconds,"
"minutes,"
"expected_seconds,"
"expected_minutes,"
"expected_text",
argvalues=[
[10, 0, 10, 0, "Delaying for 0 minutes and 10.0 seconds"],
... | en | 0.689404 | It should allow a message to be appended to the delay text. | 2.578108 | 3 |
tests/test_histogram_source.py | ess-dmsc/just-bin-it | 0 | 6830 | from unittest.mock import patch
import pytest
from just_bin_it.endpoints.sources import HistogramSource
from tests.doubles.consumer import StubConsumer
TEST_MESSAGE = b"this is a byte message"
INVALID_FB = b"this is an invalid fb message"
class TestHistogramSource:
@pytest.fixture(autouse=True)
def prepare... | from unittest.mock import patch
import pytest
from just_bin_it.endpoints.sources import HistogramSource
from tests.doubles.consumer import StubConsumer
TEST_MESSAGE = b"this is a byte message"
INVALID_FB = b"this is an invalid fb message"
class TestHistogramSource:
@pytest.fixture(autouse=True)
def prepare... | none | 1 | 2.477003 | 2 | |
lctools/shortcuts.py | novel/lc-tools | 5 | 6831 | import getopt
import sys
from libcloud.compute.types import NodeState
from lc import get_lc
from printer import Printer
def lister_main(what, resource=None,
extension=False, supports_location=False, **kwargs):
"""Shortcut for main() routine for lister
tools, e.g. lc-SOMETHING-list
@param what: ... | import getopt
import sys
from libcloud.compute.types import NodeState
from lc import get_lc
from printer import Printer
def lister_main(what, resource=None,
extension=False, supports_location=False, **kwargs):
"""Shortcut for main() routine for lister
tools, e.g. lc-SOMETHING-list
@param what: ... | en | 0.73868 | Shortcut for main() routine for lister tools, e.g. lc-SOMETHING-list @param what: what we are listing, e.g. 'nodes' @param extension: is it an extension of core libcloud functionality? @param kwargs: additional arguments for the call @type what: C{string} @param supports_location: tells that ob... | 2.568581 | 3 |
tests/test_flash_vl.py | andr1976/thermo | 380 | 6832 | <reponame>andr1976/thermo
# -*- coding: utf-8 -*-
'''Chemical Engineering Design Library (ChEDL). Utilities for process modeling.
Copyright (C) 2020, <NAME> <<EMAIL>>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to de... | # -*- coding: utf-8 -*-
'''Chemical Engineering Design Library (ChEDL). Utilities for process modeling.
Copyright (C) 2020, <NAME> <<EMAIL>>
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... | en | 0.915273 | # -*- coding: utf-8 -*- Chemical Engineering Design Library (ChEDL). Utilities for process modeling. Copyright (C) 2020, <NAME> <<EMAIL>> 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 re... | 1.223318 | 1 |
ex38.py | YunMeMeThaw/python_exercises | 0 | 6833 | <reponame>YunMeMeThaw/python_exercises<gh_stars>0
ten_things = "Apples Oranges cows Telephone Light Sugar"
print ("Wait there are not 10 things in that list. Let's fix")
stuff = ten_things.split(' ')
more_stuff = {"Day", "Night", "Song", "Firebee",
"Corn", "Banana", "Girl", "Boy"}
while len(stuff) !=10:
next_on... | ten_things = "Apples Oranges cows Telephone Light Sugar"
print ("Wait there are not 10 things in that list. Let's fix")
stuff = ten_things.split(' ')
more_stuff = {"Day", "Night", "Song", "Firebee",
"Corn", "Banana", "Girl", "Boy"}
while len(stuff) !=10:
next_one = more_stuff.pop()
print("Adding: ", next_one)
... | en | 0.494599 | # whoa! cool! # what? cool ! #super stealler! | 3.927416 | 4 |
var/spack/repos/builtin/packages/diffmark/package.py | player1537-forks/spack | 11 | 6834 | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Diffmark(AutotoolsPackage):
"""Diffmark is a DSL for transforming one string to another.""... | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Diffmark(AutotoolsPackage):
"""Diffmark is a DSL for transforming one string to another.""... | en | 0.692633 | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) Diffmark is a DSL for transforming one string to another. | 1.558559 | 2 |
bbp/comps/irikura_gen_srf.py | ZhangHCFJEA/bbp | 28 | 6835 | #!/usr/bin/env python
"""
Copyright 2010-2019 University Of Southern 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 appli... | #!/usr/bin/env python
"""
Copyright 2010-2019 University Of Southern 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 appli... | en | 0.784019 | #!/usr/bin/env python Copyright 2010-2019 University Of Southern 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 applicabl... | 2.221439 | 2 |
core/tests/test_models.py | EthanMarrs/digit2 | 0 | 6836 | """test_models.py: runs tests on the models for digit."""
import pytest
from core.models import (Grade,
Subject,
Question,
Comment,
Option,
Topic,
Block,
... | """test_models.py: runs tests on the models for digit."""
import pytest
from core.models import (Grade,
Subject,
Question,
Comment,
Option,
Topic,
Block,
... | en | 0.922053 | test_models.py: runs tests on the models for digit. Test the Question Model. Create questions for testing. Confirm that default state is Incomplete. Check that question state. Confirm that state can only go from 'incomplete' to 'ready for review'. Check that question state. Confirm that state ... | 2.925374 | 3 |
betterbib/__init__.py | tbabej/betterbib | 0 | 6837 | <filename>betterbib/__init__.py
# -*- coding: utf-8 -*-
#
from __future__ import print_function
from betterbib.__about__ import (
__version__,
__author__,
__author_email__,
__website__,
)
from betterbib.tools import (
create_dict,
decode,
pybtex_to_dict,
pybtex_to_bibtex_string,
... | <filename>betterbib/__init__.py
# -*- coding: utf-8 -*-
#
from __future__ import print_function
from betterbib.__about__ import (
__version__,
__author__,
__author_email__,
__website__,
)
from betterbib.tools import (
create_dict,
decode,
pybtex_to_dict,
pybtex_to_bibtex_string,
... | en | 0.770005 | # -*- coding: utf-8 -*- # | 2.085538 | 2 |
base/views.py | omololevy/my_portfolio | 2 | 6838 | from django.shortcuts import render, redirect
from django.http import HttpResponse
from django.contrib.auth.decorators import login_required
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.core.mail import EmailMessage
from django.conf import settings
from django.template.loader imp... | from django.shortcuts import render, redirect
from django.http import HttpResponse
from django.contrib.auth.decorators import login_required
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.core.mail import EmailMessage
from django.conf import settings
from django.template.loader imp... | en | 0.924244 | # Create your views here. #CRUD VIEWS #Little Hack to work around re-building the usermodel | 2.135249 | 2 |
radioLib/pastebin/pastebin.py | hephaestus9/Radio | 1 | 6839 | <reponame>hephaestus9/Radio
#!/usr/bin/env python
#############################################################################
# Pastebin.py - Python 3.2 Pastebin API.
# Copyright (C) 2012 <NAME>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Gene... | #!/usr/bin/env python
#############################################################################
# Pastebin.py - Python 3.2 Pastebin API.
# Copyright (C) 2012 <NAME>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publis... | en | 0.503017 | #!/usr/bin/env python ############################################################################# # Pastebin.py - Python 3.2 Pastebin API. # Copyright (C) 2012 <NAME> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as publish... | 1.643827 | 2 |
app/requests.py | seron-ux/News-app | 1 | 6840 | <gh_stars>1-10
import urllib.request,json
from .models import News
import requests
News = News
# Getting api key
api_key = None
# Getting the news base url
base_url = None
base_url2 = None
def configure_request(app):
global api_key,base_url,base_url2
api_key = app.config['NEWS_API_KEY']
base_url = app.c... | import urllib.request,json
from .models import News
import requests
News = News
# Getting api key
api_key = None
# Getting the news base url
base_url = None
base_url2 = None
def configure_request(app):
global api_key,base_url,base_url2
api_key = app.config['NEWS_API_KEY']
base_url = app.config['NEWS_API... | en | 0.750619 | # Getting api key # Getting the news base url Function that gets the json responce to our url request Function that processes the news result and transform them to a list of Objects Args: news_list: A list of dictionaries that contain news details Returns : news_results: A list of news objects ... | 2.918776 | 3 |
leetcode/151_reverse _words_in_a_string.py | caoxudong/code_practice | 1 | 6841 | """
Given an input string, reverse the string word by word.
For example,
Given s = "the sky is blue",
return "blue is sky the".
For C programmers: Try to solve it in-place in O(1) space.
Clarification:
* What constitutes a word?
A sequence of non-space characters constitutes a word.
* Could the inp... | """
Given an input string, reverse the string word by word.
For example,
Given s = "the sky is blue",
return "blue is sky the".
For C programmers: Try to solve it in-place in O(1) space.
Clarification:
* What constitutes a word?
A sequence of non-space characters constitutes a word.
* Could the inp... | en | 0.829419 | Given an input string, reverse the string word by word.
For example,
Given s = "the sky is blue",
return "blue is sky the".
For C programmers: Try to solve it in-place in O(1) space.
Clarification:
* What constitutes a word?
A sequence of non-space characters constitutes a word.
* Could the input stri... | 4.044509 | 4 |
toontown/uberdog/DistributedInGameNewsMgr.py | LittleNed/toontown-stride | 3 | 6842 | import socket, datetime, os
from direct.distributed.DistributedObjectGlobal import DistributedObjectGlobal
from direct.distributed.DistributedObject import DistributedObject
from toontown.toonbase import ToontownGlobals
from toontown.uberdog import InGameNewsResponses
class DistributedInGameNewsMgr(DistributedObject):... | import socket, datetime, os
from direct.distributed.DistributedObjectGlobal import DistributedObjectGlobal
from direct.distributed.DistributedObject import DistributedObject
from toontown.toonbase import ToontownGlobals
from toontown.uberdog import InGameNewsResponses
class DistributedInGameNewsMgr(DistributedObject):... | none | 1 | 2.138056 | 2 | |
Day10/loops.py | azeemchaudhrry/30DaysofPython | 0 | 6843 | <filename>Day10/loops.py
# Day 10 Loops
from countries import *
# While Loop
# count = 0
# while count < 5:
# if count == 3:
# break
# print(count)
# count = count + 1
# numbers = [0,2,3,4,5,6,7,8,9,10]
# for number in numbers:
# print(number)
# language = 'Python'
# for letter in language:
... | <filename>Day10/loops.py
# Day 10 Loops
from countries import *
# While Loop
# count = 0
# while count < 5:
# if count == 3:
# break
# print(count)
# count = count + 1
# numbers = [0,2,3,4,5,6,7,8,9,10]
# for number in numbers:
# print(number)
# language = 'Python'
# for letter in language:
... | en | 0.543722 | # Day 10 Loops # While Loop # count = 0 # while count < 5: # if count == 3: # break # print(count) # count = count + 1 # numbers = [0,2,3,4,5,6,7,8,9,10] # for number in numbers: # print(number) # language = 'Python' # for letter in language: # print(letter) # tpl = ('python','updates','wow'... | 3.826283 | 4 |
tessera-server/tessera/views_api.py | Dimas625/tessera | 379 | 6844 | <reponame>Dimas625/tessera<filename>tessera-server/tessera/views_api.py
# -*- mode:python -*-
import flask
import json
import logging
from datetime import datetime
import inflection
from functools import wraps
from flask import request, url_for
from werkzeug.exceptions import HTTPException
from .client.api.model imp... | # -*- mode:python -*-
import flask
import json
import logging
from datetime import datetime
import inflection
from functools import wraps
from flask import request, url_for
from werkzeug.exceptions import HTTPException
from .client.api.model import *
from . import database
from . import helpers
from .application imp... | en | 0.722754 | # -*- mode:python -*- # ============================================================================= # API Helpers # ============================================================================= Return a SQLAlchemy column descriptor to sort results by, based on the 'sort' and 'order' request parameters. Add the variou... | 2.383345 | 2 |
modules/aws_service.py | Darkcybe/attack_range | 1 | 6845 | <gh_stars>1-10
import sys
import re
import boto3
from botocore.exceptions import ClientError
import uuid
import time
import yaml
import os
def get_instance_by_name(ec2_name, config):
instances = get_all_instances(config)
for instance in instances:
str = instance['Tags'][0]['Value']
if str == ec... | import sys
import re
import boto3
from botocore.exceptions import ClientError
import uuid
import time
import yaml
import os
def get_instance_by_name(ec2_name, config):
instances = get_all_instances(config)
for instance in instances:
str = instance['Tags'][0]['Value']
if str == ec2_name:
... | en | 0.407399 | # def upload_file_s3_bucket(file_name, results, test_file, isArchive): # region = config['region'] # s3_client = boto3.client('s3', region_name=region) # if isArchive: # response = s3_client.upload_file(file_name, 'attack-range-attack-data', str(test_file['simulation_technique'] + '/attack_data.tar.... | 2.348446 | 2 |
pystacknet/metrics.py | KevinMichaelSchindler/pystacknet | 0 | 6846 | <gh_stars>0
# -*- coding: utf-8 -*-
"""
Created on Fri Aug 31 18:33:58 2018
@author: <NAME>
metrics and method to check metrics used within StackNet
"""
from sklearn.metrics import mean_squared_error, mean_absolute_error, r2_score , mean_squared_log_error #regression metrics
from sklearn.metrics import roc_auc_sco... | # -*- coding: utf-8 -*-
"""
Created on Fri Aug 31 18:33:58 2018
@author: <NAME>
metrics and method to check metrics used within StackNet
"""
from sklearn.metrics import mean_squared_error, mean_absolute_error, r2_score , mean_squared_log_error #regression metrics
from sklearn.metrics import roc_auc_score, log_loss... | en | 0.770915 | # -*- coding: utf-8 -*- Created on Fri Aug 31 18:33:58 2018 @author: <NAME> metrics and method to check metrics used within StackNet #regression metrics ############ classification metrics ############ ############ regression metrics ############ metric: string or class that returns a metric given (y_true, y_pred, sa... | 2.517464 | 3 |
check_logstash_pipeline.py | stdevel/nagios-plugins | 0 | 6847 | #!/usr/bin/env python
# coding=utf-8
# vim:ts=4:sts=4:sw=4:et
#
# Author: <NAME>
# Date: 2017-11-24 21:10:35 +0100 (Fri, 24 Nov 2017)
#
# https://github.com/harisekhon/nagios-plugins
#
# License: see accompanying Hari Sekhon LICENSE file
#
# If you're using my code you're welcome to connect with me on LinkedIn
#... | #!/usr/bin/env python
# coding=utf-8
# vim:ts=4:sts=4:sw=4:et
#
# Author: <NAME>
# Date: 2017-11-24 21:10:35 +0100 (Fri, 24 Nov 2017)
#
# https://github.com/harisekhon/nagios-plugins
#
# License: see accompanying Hari Sekhon LICENSE file
#
# If you're using my code you're welcome to connect with me on LinkedIn
#... | en | 0.695755 | #!/usr/bin/env python # coding=utf-8 # vim:ts=4:sts=4:sw=4:et # # Author: <NAME> # Date: 2017-11-24 21:10:35 +0100 (Fri, 24 Nov 2017) # # https://github.com/harisekhon/nagios-plugins # # License: see accompanying Hari Sekhon LICENSE file # # If you're using my code you're welcome to connect with me on LinkedIn #... | 1.428739 | 1 |
dags/mailsdag.py | rvacaru/airflow-training-skeleton | 0 | 6848 | <filename>dags/mailsdag.py
# -*- coding: utf-8 -*-
#
# 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 ... | <filename>dags/mailsdag.py
# -*- coding: utf-8 -*-
#
# 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 ... | en | 0.852887 | # -*- coding: utf-8 -*- # # 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 #... | 2.272563 | 2 |
appengine-compat/exported_appengine_sdk/google/storage/speckle/proto/jdbc_type.py | speedplane/python-compat-runtime | 26 | 6849 | #!/usr/bin/env python
#
# Copyright 2007 Google 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 o... | #!/usr/bin/env python
#
# Copyright 2007 Google 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 o... | en | 0.738677 | #!/usr/bin/env python # # Copyright 2007 Google 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 o... | 1.92322 | 2 |
GestiRED/views.py | osabogal10/GestiREDBackend | 0 | 6850 | from django.http import HttpResponse
from django.core.mail import send_mail
import json
from django.shortcuts import render
from django.views.decorators.csrf import csrf_exempt
from GestiRED.models import User
from GestiRED.models import QualityControl, Phase, Resource, ResourceType,PhaseType
from django.core import se... | from django.http import HttpResponse
from django.core.mail import send_mail
import json
from django.shortcuts import render
from django.views.decorators.csrf import csrf_exempt
from GestiRED.models import User
from GestiRED.models import QualityControl, Phase, Resource, ResourceType,PhaseType
from django.core import se... | en | 0.93711 | # Create your views here. # Your dict with fields | 1.900201 | 2 |
ext_modules/_maix_nn/example/yolo2_camera.py | sipeed/python3-maix | 93 | 6851 | <gh_stars>10-100
from maix import nn
from PIL import Image, ImageDraw, ImageFont
from maix import display, camera
import time
from maix.nn import decoder
def draw_rectangle_with_title(draw, box, disp_str, bg_color=(255, 0, 0, 255), font_color=(255, 255, 255, 255)):
# draw = ImageDraw.Draw(img)
font = Imag... | from maix import nn
from PIL import Image, ImageDraw, ImageFont
from maix import display, camera
import time
from maix.nn import decoder
def draw_rectangle_with_title(draw, box, disp_str, bg_color=(255, 0, 0, 255), font_color=(255, 255, 255, 255)):
# draw = ImageDraw.Draw(img)
font = ImageFont.load_default()
... | en | 0.484469 | # draw = ImageDraw.Draw(img) # # img.show() | 2.348531 | 2 |
tests/test_metadata_options.py | Fatal1ty/mashumaro | 394 | 6852 | from dataclasses import dataclass, field
from datetime import date, datetime, time, timezone
from pathlib import Path
from typing import Any, Dict, Optional, Union
import ciso8601
import pytest
from mashumaro import DataClassDictMixin
from mashumaro.exceptions import UnserializableField
from mashumaro.types import Se... | from dataclasses import dataclass, field
from datetime import date, datetime, time, timezone
from pathlib import Path
from typing import Any, Dict, Optional, Union
import ciso8601
import pytest
from mashumaro import DataClassDictMixin
from mashumaro.exceptions import UnserializableField
from mashumaro.types import Se... | none | 1 | 2.32297 | 2 | |
vendor/github.com/tensorflow/tensorflow/tensorflow/python/ops/list_ops.py | owennewo/kfserving | 2 | 6853 | # 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.836474 | # 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... | 2.323273 | 2 |
tests/test_dump.py | flaeppe/astunparse | 189 | 6854 | import ast
import re
import sys
if sys.version_info < (2, 7):
import unittest2 as unittest
else:
import unittest
import astunparse
from tests.common import AstunparseCommonTestCase
class DumpTestCase(AstunparseCommonTestCase, unittest.TestCase):
def assertASTEqual(self, dump1, dump2):
# undo the ... | import ast
import re
import sys
if sys.version_info < (2, 7):
import unittest2 as unittest
else:
import unittest
import astunparse
from tests.common import AstunparseCommonTestCase
class DumpTestCase(AstunparseCommonTestCase, unittest.TestCase):
def assertASTEqual(self, dump1, dump2):
# undo the ... | en | 0.904523 | # undo the pretty-printing | 2.528649 | 3 |
src/django/giraffe/blat/management/commands/reset_app.py | addgene/giraffe | 4 | 6855 | <gh_stars>1-10
from django.core.management.base import AppCommand, CommandError
from django.core.management.sql import sql_reset
from django.core.management.color import no_style
from django.db import connections
class Command(AppCommand):
help = "**********\nThis command resets data for any django app, the differ... | from django.core.management.base import AppCommand, CommandError
from django.core.management.sql import sql_reset
from django.core.management.color import no_style
from django.db import connections
class Command(AppCommand):
help = "**********\nThis command resets data for any django app, the difference with the b... | none | 1 | 2.332314 | 2 | |
webBlog/apps.py | JordanBRoberts/python-theBand | 0 | 6856 | <gh_stars>0
from django.apps import AppConfig
class WebblogConfig(AppConfig):
name = 'webBlog'
| from django.apps import AppConfig
class WebblogConfig(AppConfig):
name = 'webBlog' | none | 1 | 1.178062 | 1 | |
requires.py | lydaaa/fzutils | 1 | 6857 | <reponame>lydaaa/fzutils
# coding:utf-8
'''
@author = super_fazai
@File : requires.py
@Time : 2016/8/3 12:59
@connect : <EMAIL>
'''
install_requires = [
'ipython',
'wheel',
'utils',
'db',
'greenlet==0.4.13',
'web.py==0.40.dev1',
'pytz',
'requests',
'selenium==3.8.0', # 3.... | # coding:utf-8
'''
@author = super_fazai
@File : requires.py
@Time : 2016/8/3 12:59
@connect : <EMAIL>
'''
install_requires = [
'ipython',
'wheel',
'utils',
'db',
'greenlet==0.4.13',
'web.py==0.40.dev1',
'pytz',
'requests',
'selenium==3.8.0', # 3.8.1及其以上版本不支持phantomjs了
... | zh | 0.348559 | # coding:utf-8 @author = super_fazai @File : requires.py @Time : 2016/8/3 12:59 @connect : <EMAIL> # 3.8.1及其以上版本不支持phantomjs了 # shell 抓包代理 # 'pycurl==192.168.127.12', # 词云 | 1.288272 | 1 |
m15_dos/dos.py | venkatarjun/Python3 | 80 | 6858 | <gh_stars>10-100
import subprocess
import requests
import argparse
from concurrent.futures import ThreadPoolExecutor
from time import sleep
from datetime import datetime
ICMP_ATTACK = "ICMP"
HTTP_ATTACK = "HTTP"
valid_attacks = {HTTP_ATTACK, ICMP_ATTACK}
parser = argparse.ArgumentParser(description="DoS HTTP")
parser... | import subprocess
import requests
import argparse
from concurrent.futures import ThreadPoolExecutor
from time import sleep
from datetime import datetime
ICMP_ATTACK = "ICMP"
HTTP_ATTACK = "HTTP"
valid_attacks = {HTTP_ATTACK, ICMP_ATTACK}
parser = argparse.ArgumentParser(description="DoS HTTP")
parser.add_argument('-P... | en | 0.970879 | # should not have gotten here | 2.756569 | 3 |
maestro/backends/django/contrib/signals.py | estudio89/maestro-python | 0 | 6859 | <gh_stars>0
from django.apps import apps
from django.db import models
from django.db.models.signals import post_save, pre_delete
from typing import Type, Optional, List, cast, TYPE_CHECKING
from maestro.backends.django.settings import maestro_settings
from maestro.backends.django.contrib.factory import create_django_da... | from django.apps import apps
from django.db import models
from django.db.models.signals import post_save, pre_delete
from typing import Type, Optional, List, cast, TYPE_CHECKING
from maestro.backends.django.settings import maestro_settings
from maestro.backends.django.contrib.factory import create_django_data_store
fro... | none | 1 | 2.035808 | 2 | |
top/urls.py | pbexe/nextbike-top | 0 | 6860 | from django.urls import include, path
from .views import home, bike
urlpatterns = [
path("", home),
path("bike/<int:number>", bike)
] | from django.urls import include, path
from .views import home, bike
urlpatterns = [
path("", home),
path("bike/<int:number>", bike)
] | none | 1 | 1.782115 | 2 | |
Scripts/ReduceFragments.py | mike72353/FragFeatureNet | 1 | 6861 | """
Remove Fragments not in Knowledgebase
"""
__author__ = "<NAME>"
__email__ = "<EMAIL>"
__copyright__ = "Copyright 2019, Hong Kong University of Science and Technology"
__license__ = "3-clause BSD"
from argparse import ArgumentParser
import numpy as np
import pickle
parser = ArgumentParser(description="Build Files... | """
Remove Fragments not in Knowledgebase
"""
__author__ = "<NAME>"
__email__ = "<EMAIL>"
__copyright__ = "Copyright 2019, Hong Kong University of Science and Technology"
__license__ = "3-clause BSD"
from argparse import ArgumentParser
import numpy as np
import pickle
parser = ArgumentParser(description="Build Files... | en | 0.698372 | Remove Fragments not in Knowledgebase # Check the Bound Fragments # Checks whether the Fragment can be found in the 59k Fragment Base #Finds the maximum number of Fragments per environment -> 705 # Removes environments without binding Fragments # Removes environment annotiation without binding fragments | 2.455001 | 2 |
client/core/tests/billing_tests.py | vbohinc/CommunityCellularManager | 0 | 6862 | """Tests for core.billing.
Run this test from the project root
$ nosetests core.tests.billing_tests
Copyright (c) 2016-present, Facebook, Inc.
All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree. An additional grant
of ... | """Tests for core.billing.
Run this test from the project root
$ nosetests core.tests.billing_tests
Copyright (c) 2016-present, Facebook, Inc.
All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree. An additional grant
of ... | en | 0.888151 | Tests for core.billing. Run this test from the project root $ nosetests core.tests.billing_tests Copyright (c) 2016-present, Facebook, Inc. All rights reserved. This source code is licensed under the BSD-style license found in the LICENSE file in the root directory of this source tree. An additional grant of pat... | 2.265621 | 2 |
data_interrogator/admin/views.py | s-i-l-k-e/django-data-interrogator | 0 | 6863 | <reponame>s-i-l-k-e/django-data-interrogator
from django.contrib.auth.decorators import user_passes_test
from django.utils.decorators import method_decorator
from data_interrogator.admin.forms import AdminInvestigationForm, AdminPivotTableForm
from data_interrogator.interrogators import Allowable
from data_interrogato... | from django.contrib.auth.decorators import user_passes_test
from django.utils.decorators import method_decorator
from data_interrogator.admin.forms import AdminInvestigationForm, AdminPivotTableForm
from data_interrogator.interrogators import Allowable
from data_interrogator.views import InterrogationView, Interrogati... | none | 1 | 1.869277 | 2 | |
configs/pspnet/pspnet_r18-d8_512x512_80k_loveda.py | heytanay/mmsegmentation | 11 | 6864 | <filename>configs/pspnet/pspnet_r18-d8_512x512_80k_loveda.py
_base_ = './pspnet_r50-d8_512x512_80k_loveda.py'
model = dict(
backbone=dict(
depth=18,
init_cfg=dict(
type='Pretrained', checkpoint='open-mmlab://resnet18_v1c')),
decode_head=dict(
in_channels=512,
channels... | <filename>configs/pspnet/pspnet_r18-d8_512x512_80k_loveda.py
_base_ = './pspnet_r50-d8_512x512_80k_loveda.py'
model = dict(
backbone=dict(
depth=18,
init_cfg=dict(
type='Pretrained', checkpoint='open-mmlab://resnet18_v1c')),
decode_head=dict(
in_channels=512,
channels... | none | 1 | 1.207961 | 1 | |
bba/objects.py | TheGenocides/BBA | 3 | 6865 | <reponame>TheGenocides/BBA
from typing import Dict, Any
class ResponseObject:
def __init__(self, data: Dict[str, Any]):
self.payload = data
for k, v in data.items():
setattr(self, k, v) | from typing import Dict, Any
class ResponseObject:
def __init__(self, data: Dict[str, Any]):
self.payload = data
for k, v in data.items():
setattr(self, k, v) | none | 1 | 2.632549 | 3 | |
apps/greencheck/forms.py | BR0kEN-/admin-portal | 0 | 6866 | from django import forms
from django.forms import ModelForm
from django.contrib.auth import get_user_model
from django.core.exceptions import ValidationError
from .choices import ActionChoice
from .choices import StatusApproval
from .models import GreencheckIp
from .models import GreencheckIpApprove
from .models impor... | from django import forms
from django.forms import ModelForm
from django.contrib.auth import get_user_model
from django.core.exceptions import ValidationError
from .choices import ActionChoice
from .choices import StatusApproval
from .models import GreencheckIp
from .models import GreencheckIpApprove
from .models impor... | en | 0.8802 | Save the approval request, be it an IP Range or an AS Network from a # changed here represents an # when using this form `is_staff` should always be available # or else something has gone wrong... This form is meant for admin If a non staff user fills in the form it would return an unsaved approval rec... | 2.194136 | 2 |
apps/utils/format/url_format.py | think-wang/osroom | 1 | 6867 | #!/usr/bin/env python
# -*-coding:utf-8-*-
from tld import get_tld
__author__ = "<NAME>"
def get_domain(url):
'''
获取url中的全域名
:param url:
:return:
'''
res = get_tld(url, as_object=True)
return "{}.{}".format(res.subdomain, res.tld) | #!/usr/bin/env python
# -*-coding:utf-8-*-
from tld import get_tld
__author__ = "<NAME>"
def get_domain(url):
'''
获取url中的全域名
:param url:
:return:
'''
res = get_tld(url, as_object=True)
return "{}.{}".format(res.subdomain, res.tld) | zh | 0.342424 | #!/usr/bin/env python # -*-coding:utf-8-*- 获取url中的全域名 :param url: :return: | 2.569355 | 3 |
ipamanager/entities.py | Tjev/freeipa-manager | 0 | 6868 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# SPDX-License-Identifier: BSD-3-Clause
# Copyright © 2017-2019, GoodData Corporation. All rights reserved.
"""
FreeIPA Manager - entity module
Object representations of the entities configured in FreeIPA.
"""
import os
import re
import voluptuous
import yaml
from abc imp... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# SPDX-License-Identifier: BSD-3-Clause
# Copyright © 2017-2019, GoodData Corporation. All rights reserved.
"""
FreeIPA Manager - entity module
Object representations of the entities configured in FreeIPA.
"""
import os
import re
import voluptuous
import yaml
from abc imp... | en | 0.776563 | #!/usr/bin/env python # -*- coding: utf-8 -*- # SPDX-License-Identifier: BSD-3-Clause # Copyright © 2017-2019, GoodData Corporation. All rights reserved. FreeIPA Manager - entity module Object representations of the entities configured in FreeIPA. General FreeIPA entity (user, group etc.) representation. Can only ... | 2.013524 | 2 |
test/test_catalog_manager.py | weknowtraining/athena-glue-service-logs | 133 | 6869 | # pylint: skip-file
from athena_glue_service_logs.catalog_manager import BaseCatalogManager
def test_class_init(mocker):
mocker.patch.multiple(BaseCatalogManager, __abstractmethods__=set())
base_catalog = BaseCatalogManager('us-west-2', 'dbname', 'tablename', 's3://somewhere')
assert base_catalog.databas... | # pylint: skip-file
from athena_glue_service_logs.catalog_manager import BaseCatalogManager
def test_class_init(mocker):
mocker.patch.multiple(BaseCatalogManager, __abstractmethods__=set())
base_catalog = BaseCatalogManager('us-west-2', 'dbname', 'tablename', 's3://somewhere')
assert base_catalog.databas... | en | 0.409619 | # pylint: skip-file | 1.944974 | 2 |
unsorted/pythonsnippets_0013.py | fiddlerwoaroof/sandbox | 0 | 6870 | from twisted.internet import reactor
reactor.listenTCP(8789, factory)
reactor.run() | from twisted.internet import reactor
reactor.listenTCP(8789, factory)
reactor.run() | none | 1 | 1.392788 | 1 | |
__main__.py | SHUcream00/MLBPitchVisual | 0 | 6871 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
def visualize(dataframe, balltype):
df = dataframe
#Filter by balltype
res = df[df["pitch_type"] == balltype]
#Group by results
groups = res.groupby("description")
for name, group in groups:
if name ==... | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
def visualize(dataframe, balltype):
df = dataframe
#Filter by balltype
res = df[df["pitch_type"] == balltype]
#Group by results
groups = res.groupby("description")
for name, group in groups:
if name ==... | en | 0.88891 | #Filter by balltype #Group by results #Fixing the viewpoint of the plot #Setting strike zone #Drawing strike zone #Setting labels #Setting up Name and CSV location #For filtering cases | 3.370463 | 3 |
shape_similarity.py | Toonwire/infancy_eye_tracking | 0 | 6872 | # -*- coding: utf-8 -*-
"""
Created on Sat May 25 13:17:49 2019
@author: Toonw
"""
import numpy as np
def vlen(a):
return (a[0]**2 + a[1]**2)**0.5
def add(v1,v2):
return (v1[0]+v2[0], v1[1]+v2[1])
def sub(v1,v2):
return (v1[0]-v2[0], v1[1]-v2[1])
def unit_vector(v):
vu = v / np.linalg.norm(v)
... | # -*- coding: utf-8 -*-
"""
Created on Sat May 25 13:17:49 2019
@author: Toonw
"""
import numpy as np
def vlen(a):
return (a[0]**2 + a[1]**2)**0.5
def add(v1,v2):
return (v1[0]+v2[0], v1[1]+v2[1])
def sub(v1,v2):
return (v1[0]-v2[0], v1[1]-v2[1])
def unit_vector(v):
vu = v / np.linalg.norm(v)
... | en | 0.639564 | # -*- coding: utf-8 -*- Created on Sat May 25 13:17:49 2019 @author: Toonw # Similarity measure of article ## https://pdfs.semanticscholar.org/60b5/aca20ba34d424f4236359bd5e6aa30487682.pdf # similarity between two shapes A and B # print(A) # print(B) | 2.856832 | 3 |
apps/chats/apps.py | aldwyn/effigia | 1 | 6873 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.apps import AppConfig
class ChatsConfig(AppConfig):
name = 'apps.chats'
def ready(self):
from actstream import registry
registry.register(*self.get_models())
| # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.apps import AppConfig
class ChatsConfig(AppConfig):
name = 'apps.chats'
def ready(self):
from actstream import registry
registry.register(*self.get_models())
| en | 0.769321 | # -*- coding: utf-8 -*- | 1.737855 | 2 |
utils/ghost.py | JayJJChen/LoveXueXiQiangGuo | 3 | 6874 | <gh_stars>1-10
import os
import time
from utils.eye import Eye
from utils.finger import Finger
class Ghost:
"""class to navigate the app, with Eye and Finger"""
def __init__(self, adb_path, temp_path, sleep_sec=2):
self.eye = Eye(adb_path, temp_path)
self.finger = Finger(adb_path, sleep_sec=... | import os
import time
from utils.eye import Eye
from utils.finger import Finger
class Ghost:
"""class to navigate the app, with Eye and Finger"""
def __init__(self, adb_path, temp_path, sleep_sec=2):
self.eye = Eye(adb_path, temp_path)
self.finger = Finger(adb_path, sleep_sec=sleep_sec)
... | en | 0.809919 | class to navigate the app, with Eye and Finger back to main page, doesn't support back from exam # failsafe click the score from main page go to the exam page root from main page exit during exam to main find available weekly exam in weekly exam page # swipe up if there's no "start_exam" navigate to bottom n_th tab, th... | 3.010447 | 3 |
src_taxonomy/bubble_tree_map.py | sanja7s/SR_Twitter | 0 | 6875 | <filename>src_taxonomy/bubble_tree_map.py
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import random
from ete2 import Tree, TreeStyle, NodeStyle, faces, AttrFace, CircleFace, TextFace
def layout(node):
if not node.is_root():
# Add node name to laef nodes
#N = AttrFace("name", fsize=14, fgcolor="black")
#faces... | <filename>src_taxonomy/bubble_tree_map.py
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import random
from ete2 import Tree, TreeStyle, NodeStyle, faces, AttrFace, CircleFace, TextFace
def layout(node):
if not node.is_root():
# Add node name to laef nodes
#N = AttrFace("name", fsize=14, fgcolor="black")
#faces... | en | 0.600464 | #!/usr/bin/env python # -*- coding: UTF-8 -*- # Add node name to laef nodes #N = AttrFace("name", fsize=14, fgcolor="black") #faces.add_face_to_node(N, node, 0) #pass # Creates a sphere face whose size is proportional to node's # feature "weight" # Let's make the sphere transparent # And place as a float face over the ... | 3.418018 | 3 |
compass/core/_scrapers/member.py | MrNoScript/compass-interface-core | 0 | 6876 | <reponame>MrNoScript/compass-interface-core
from __future__ import annotations
import re
import time
from typing import get_args, Literal, TYPE_CHECKING, Union
from lxml import html
from compass.core.interface_base import InterfaceBase
from compass.core.logger import logger
from compass.core.schemas import member as... | from __future__ import annotations
import re
import time
from typing import get_args, Literal, TYPE_CHECKING, Union
from lxml import html
from compass.core.interface_base import InterfaceBase
from compass.core.logger import logger
from compass.core.schemas import member as schema
from compass.core.settings import Se... | en | 0.532563 | Class directly interfaces with Compass operations to extract member data. Compass's MemberProfile.aspx has 13 tabs: 1. Personal Details (No Key) 2. Your Children (Page=CHILD) 3. Roles (Page=ROLES) 4. Permits (Page=PERMITS) 5. Training (Page=TRAINING) 6. Awards (Page=AWARDS) 7. Yo... | 2.067765 | 2 |
quran_text/urls.py | Quran-Tafseer/tafseer_api | 16 | 6877 | <filename>quran_text/urls.py
from django.urls import path
from . import views
urlpatterns = [
path('',
view=views.SuraListView.as_view(), name='sura-list'),
path('<int:sura_num>/<int:number>/',
view=views.AyahTextView.as_view(), name='ayah-detail'),
path('<int:sura_num>/<int:number>',
... | <filename>quran_text/urls.py
from django.urls import path
from . import views
urlpatterns = [
path('',
view=views.SuraListView.as_view(), name='sura-list'),
path('<int:sura_num>/<int:number>/',
view=views.AyahTextView.as_view(), name='ayah-detail'),
path('<int:sura_num>/<int:number>',
... | none | 1 | 1.880295 | 2 | |
konnection/settings/local.py | IanSeng/CMPUT404_PROJECT | 0 | 6878 | <filename>konnection/settings/local.py
from konnection.settings.base import *
from pathlib import Path
import os
import dotenv
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent.parent
# SECURITY WARNING: don't run with debug turned on in production!
DE... | <filename>konnection/settings/local.py
from konnection.settings.base import *
from pathlib import Path
import os
import dotenv
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent.parent
# SECURITY WARNING: don't run with debug turned on in production!
DE... | en | 0.630497 | # Build paths inside the project like this: BASE_DIR / 'subdir'. # SECURITY WARNING: don't run with debug turned on in production! # For tests # https://stackoverflow.com/a/35224204 # Adding secrets to env file # From StackOverflow https://stackoverflow.com/a/61437799 # From <NAME> https://stackoverflow.com/users/10415... | 1.913541 | 2 |
main.py | PotentialParadox/PyReparm | 0 | 6879 | <gh_stars>0
import random
from evaluation import Evaluator
from generator import generator
from mutate import mutateset
from deap import base
from deap import creator
from deap import tools
from parameter_group import ParameterGroup
import gaussian_output
from analysis import Analysis
from gaussian_input import Gaussia... | import random
from evaluation import Evaluator
from generator import generator
from mutate import mutateset
from deap import base
from deap import creator
from deap import tools
from parameter_group import ParameterGroup
import gaussian_output
from analysis import Analysis
from gaussian_input import GaussianInput
from ... | de | 0.448103 | ############################################# # BEGIN USER INPUT ############################################# ############################################ # END USER INPUT ############################################ ############################################# # BEGIN USER INPUT ##############... | 1.91318 | 2 |
pyx12/test/test_x12context.py | arenius/pyx12 | 1 | 6880 | import unittest
#import tempfile
try:
from StringIO import StringIO
except:
from io import StringIO
import pyx12.error_handler
from pyx12.errors import EngineError # , X12PathError
import pyx12.x12context
import pyx12.params
from pyx12.test.x12testdata import datafiles
class X12fileTestCase(unittest.TestCas... | import unittest
#import tempfile
try:
from StringIO import StringIO
except:
from io import StringIO
import pyx12.error_handler
from pyx12.errors import EngineError # , X12PathError
import pyx12.x12context
import pyx12.params
from pyx12.test.x12testdata import datafiles
class X12fileTestCase(unittest.TestCas... | en | 0.461029 | #import tempfile # , X12PathError #def test_select_loop_and_parent(self): # loop2400 = self.loop2300.first('2400') # assert loop2400.id == '2400', 'Not in 2400' # ct = 0 # newtree = loop2400.parent # for newtree in loop2400.select('../'): # self.assertEqual(newtree.id, '2300') # ct += 1 # ... | 2.407742 | 2 |
repo/script.module.liveresolver/lib/liveresolver/resolvers/finecast.py | Hades01/Addons | 3 | 6881 | <reponame>Hades01/Addons<filename>repo/script.module.liveresolver/lib/liveresolver/resolvers/finecast.py<gh_stars>1-10
# -*- coding: utf-8 -*-
import re,urlparse,cookielib,os,urllib
from liveresolver.modules import client,recaptcha_v2,control,constants, decryptionUtils
from liveresolver.modules.log_utils import log
c... | # -*- coding: utf-8 -*-
import re,urlparse,cookielib,os,urllib
from liveresolver.modules import client,recaptcha_v2,control,constants, decryptionUtils
from liveresolver.modules.log_utils import log
cookieFile = os.path.join(control.dataPath, 'finecastcookie.lwp')
def resolve(url):
#try:
try:
... | en | 0.506694 | # -*- coding: utf-8 -*- #try: #1:04 #except: # return | 2.107114 | 2 |
src/robotide/publish/__init__.py | crylearner/RIDE3X | 1 | 6882 | <filename>src/robotide/publish/__init__.py<gh_stars>1-10
# Copyright 2008-2015 Nokia Solutions and Networks
#
# 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.apach... | <filename>src/robotide/publish/__init__.py<gh_stars>1-10
# Copyright 2008-2015 Nokia Solutions and Networks
#
# 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.apach... | en | 0.791244 | # Copyright 2008-2015 Nokia Solutions and Networks # # 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... | 1.986861 | 2 |
app.py | pizzapanther/google-actions-python-example | 9 | 6883 | #!/usr/bin/env python
import os
import json
import tornado.ioloop
import tornado.log
import tornado.web
from google.oauth2 import id_token
from google.auth.transport import requests as google_requests
import jwt
import requests
API_KEY = os.environ.get('OPEN_WEATHER_MAP_KEY', None)
PROJECT_ID = os.environ.get('PRO... | #!/usr/bin/env python
import os
import json
import tornado.ioloop
import tornado.log
import tornado.web
from google.oauth2 import id_token
from google.auth.transport import requests as google_requests
import jwt
import requests
API_KEY = os.environ.get('OPEN_WEATHER_MAP_KEY', None)
PROJECT_ID = os.environ.get('PRO... | en | 0.478972 | #!/usr/bin/env python # Makes external request, remove if not needed to speed things up | 2.493291 | 2 |
ProsperFlask/{{cookiecutter.project_name}}/tests/conftest.py | EVEprosper/ProsperCookiecutters | 0 | 6884 | <filename>ProsperFlask/{{cookiecutter.project_name}}/tests/conftest.py
# AUTOGENERATED BY: ProsperCookiecutters/ProsperFlask
# TEMPLATE VERSION: {{cookiecutter.template_version}}
# AUTHOR: {{cookiecutter.author_name}}
"""PyTest fixtures and modifiers"""
import pytest
from {{cookiecutter.library_name}}.endpoints impo... | <filename>ProsperFlask/{{cookiecutter.project_name}}/tests/conftest.py
# AUTOGENERATED BY: ProsperCookiecutters/ProsperFlask
# TEMPLATE VERSION: {{cookiecutter.template_version}}
# AUTHOR: {{cookiecutter.author_name}}
"""PyTest fixtures and modifiers"""
import pytest
from {{cookiecutter.library_name}}.endpoints impo... | en | 0.504359 | # AUTOGENERATED BY: ProsperCookiecutters/ProsperFlask # TEMPLATE VERSION: {{cookiecutter.template_version}} # AUTHOR: {{cookiecutter.author_name}} PyTest fixtures and modifiers flask test hook for dry-running Flask code | 1.436651 | 1 |
zoloto/coords.py | RealOrangeOne/yuri | 7 | 6885 | from typing import Iterator, NamedTuple, Tuple
from cached_property import cached_property
from cv2 import Rodrigues
from pyquaternion import Quaternion
class Coordinates(NamedTuple):
"""
:param float x: X coordinate
:param float y: Y coordinate
"""
x: float
y: float
class ThreeDCoordinate... | from typing import Iterator, NamedTuple, Tuple
from cached_property import cached_property
from cv2 import Rodrigues
from pyquaternion import Quaternion
class Coordinates(NamedTuple):
"""
:param float x: X coordinate
:param float y: Y coordinate
"""
x: float
y: float
class ThreeDCoordinate... | en | 0.722806 | :param float x: X coordinate :param float y: Y coordinate :param float x: X coordinate :param float y: Y coordinate :param float z: Z coordinate :param float rot_x: Rotation around the X-axis, in radians :param float rot_y: Rotation around the Y-axis, in radians :param float dist: Distance The orien... | 3.38154 | 3 |
azure-mgmt-recoveryservicesbackup/azure/mgmt/recoveryservicesbackup/models/bms_container_query_object.py | JonathanGailliez/azure-sdk-for-python | 1 | 6886 | # coding=utf-8
# --------------------------------------------------------------------------
# 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 ... | # coding=utf-8
# --------------------------------------------------------------------------
# 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 ... | en | 0.501549 | # coding=utf-8 # -------------------------------------------------------------------------- # 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 ... | 1.70226 | 2 |
ia870/iagradm.py | rdenadai/ia870p3 | 5 | 6887 | <filename>ia870/iagradm.py<gh_stars>1-10
# -*- encoding: utf-8 -*-
# Module iagradm
def iagradm(f, Bdil=None, Bero=None):
from ia870 import iasubm,iadil,iaero,iasecross
if Bdil is None: Bdil = iasecross()
if Bero is None: Bero = iasecross()
y = iasubm( iadil(f,Bdil),iaero(f,Bero))
return y
| <filename>ia870/iagradm.py<gh_stars>1-10
# -*- encoding: utf-8 -*-
# Module iagradm
def iagradm(f, Bdil=None, Bero=None):
from ia870 import iasubm,iadil,iaero,iasecross
if Bdil is None: Bdil = iasecross()
if Bero is None: Bero = iasecross()
y = iasubm( iadil(f,Bdil),iaero(f,Bero))
return y
| en | 0.438691 | # -*- encoding: utf-8 -*- # Module iagradm | 2.419031 | 2 |
backend/api/tests/test_models/test_utils/test_ranking_suffixes.py | ChristchurchCityWeightlifting/lifter-api | 0 | 6888 | <filename>backend/api/tests/test_models/test_utils/test_ranking_suffixes.py
import pytest
from api.models.utils import rankings
@pytest.fixture
def test_data():
return [1, 11, 101]
def test_rankings(test_data):
"""Tests if ranking works
e.g. 1 returns 1st
11 returns 11th
101 return 10... | <filename>backend/api/tests/test_models/test_utils/test_ranking_suffixes.py
import pytest
from api.models.utils import rankings
@pytest.fixture
def test_data():
return [1, 11, 101]
def test_rankings(test_data):
"""Tests if ranking works
e.g. 1 returns 1st
11 returns 11th
101 return 10... | en | 0.527436 | Tests if ranking works e.g. 1 returns 1st 11 returns 11th 101 return 101st | 2.637758 | 3 |
web/web-lemonthinker/src/app/app.py | NoXLaw/RaRCTF2021-Challenges-Public | 2 | 6889 | <filename>web/web-lemonthinker/src/app/app.py
from flask import Flask, request, redirect, url_for
import os
import random
import string
import time # lemonthink
clean = time.time()
app = Flask(__name__)
chars = list(string.ascii_letters + string.digits)
@app.route('/')
def main():
return open("index.html").read()... | <filename>web/web-lemonthinker/src/app/app.py
from flask import Flask, request, redirect, url_for
import os
import random
import string
import time # lemonthink
clean = time.time()
app = Flask(__name__)
chars = list(string.ascii_letters + string.digits)
@app.route('/')
def main():
return open("index.html").read()... | en | 0.481873 | # lemonthink | 2.518284 | 3 |
aprendizado/codewars/descending_order.py | renatodev95/Python | 0 | 6890 | # Your task is to make a function that can take any non-negative integer as an argument and return it with its digits in descending order. Essentially, rearrange the digits to create the highest possible number.
# Função que recebe um número inteiro (não negativo) como argumento e o retorna com os dígitos em ordem des... | # Your task is to make a function that can take any non-negative integer as an argument and return it with its digits in descending order. Essentially, rearrange the digits to create the highest possible number.
# Função que recebe um número inteiro (não negativo) como argumento e o retorna com os dígitos em ordem des... | pt | 0.914014 | # Your task is to make a function that can take any non-negative integer as an argument and return it with its digits in descending order. Essentially, rearrange the digits to create the highest possible number. # Função que recebe um número inteiro (não negativo) como argumento e o retorna com os dígitos em ordem desc... | 4.27118 | 4 |
dmarc_storage.py | Schramp/dmarc-monitoring | 1 | 6891 | import sqlite3
import os
import datetime
__all__ = ['DMARCStorage', 'totimestamp']
def totimestamp(datetime_object):
if datetime_object.utcoffset() is not None:
utc_naive = datetime_object.replace(tzinfo=None) - datetime_object.utcoffset()
else:
utc_naive = datetime_object
return (utc_nai... | import sqlite3
import os
import datetime
__all__ = ['DMARCStorage', 'totimestamp']
def totimestamp(datetime_object):
if datetime_object.utcoffset() is not None:
utc_naive = datetime_object.replace(tzinfo=None) - datetime_object.utcoffset()
else:
utc_naive = datetime_object
return (utc_nai... | en | 0.537724 | # Create or connect to the database: # Set automcommit to true and initialise cursor: # Create the tables if they don't exist already: CREATE TABLE IF NOT EXISTS dmarc_reports ( report_id TEXT PRIMARY KEY, receiver TEXT, rep... | 2.54759 | 3 |
setup.py | mcdruid/sumologic-python-sdk | 4 | 6892 | from setuptools import setup, find_packages
setup(
name="sumologic-sdk",
version="0.1.9",
packages=find_packages(),
install_requires=['requests>=2.2.1'],
# PyPI metadata
author="<NAME>, <NAME>",
author_email="<EMAIL>, <EMAIL>",
description="Sumo Logic Python SDK",
license="PSF",
... | from setuptools import setup, find_packages
setup(
name="sumologic-sdk",
version="0.1.9",
packages=find_packages(),
install_requires=['requests>=2.2.1'],
# PyPI metadata
author="<NAME>, <NAME>",
author_email="<EMAIL>, <EMAIL>",
description="Sumo Logic Python SDK",
license="PSF",
... | es | 0.267747 | # PyPI metadata | 1.213609 | 1 |
docs/conf.py | urm8/django-translations | 100 | 6893 | <reponame>urm8/django-translations
# -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup -------------------------... | # -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup ------------------------------------------------------------... | en | 0.555497 | # -*- coding: utf-8 -*- # # Configuration file for the Sphinx documentation builder. # # This file does only contain a selection of the most common options. For a # full list see the documentation: # http://www.sphinx-doc.org/en/master/config # -- Path setup -------------------------------------------------------------... | 1.668484 | 2 |
skorecard/metrics/__init__.py | orchardbirds/skorecard-1 | 0 | 6894 | <reponame>orchardbirds/skorecard-1
"""Import required Metric."""
from .metrics import IV_scorer
__all__ = ["IV_scorer"]
| """Import required Metric."""
from .metrics import IV_scorer
__all__ = ["IV_scorer"] | en | 0.677956 | Import required Metric. | 0.945124 | 1 |
src/waldur_core/core/tests/helpers.py | geant-multicloud/MCMS-mastermind | 26 | 6895 | import copy
from django.conf import settings
from django.test.utils import override_settings
from rest_framework import status, test
class PermissionsTest(test.APITransactionTestCase):
"""
Abstract class for permissions tests.
Methods `get_urls_configs`, `get_users_with_permission`,
`get_users_witho... | import copy
from django.conf import settings
from django.test.utils import override_settings
from rest_framework import status, test
class PermissionsTest(test.APITransactionTestCase):
"""
Abstract class for permissions tests.
Methods `get_urls_configs`, `get_users_with_permission`,
`get_users_witho... | en | 0.67168 | Abstract class for permissions tests. Methods `get_urls_configs`, `get_users_with_permission`, `get_users_without_permissions` have to be overridden. Logical example: class ExamplePermissionsTest(PermissionsTest): def get_users_with_permission(self, url, method): if is_unreachabl... | 2.382707 | 2 |
data/benchmark.py | Gummary/denet | 343 | 6896 | <reponame>Gummary/denet
"""
CutBlur
Copyright 2020-present NAVER corp.
MIT license
"""
import os
import glob
import data
class BenchmarkSR(data.BaseDataset):
def __init__(self, phase, opt):
root = opt.dataset_root
self.scale = opt.scale
dir_HQ, dir_LQ = self.get_subdir()
self.HQ_pa... | """
CutBlur
Copyright 2020-present NAVER corp.
MIT license
"""
import os
import glob
import data
class BenchmarkSR(data.BaseDataset):
def __init__(self, phase, opt):
root = opt.dataset_root
self.scale = opt.scale
dir_HQ, dir_LQ = self.get_subdir()
self.HQ_paths = sorted(glob.glob(o... | en | 0.372555 | CutBlur Copyright 2020-present NAVER corp. MIT license | 2.586799 | 3 |
pytglib/api/types/update_chat_is_pinned.py | iTeam-co/pytglib | 6 | 6897 | <gh_stars>1-10
from ..utils import Object
class UpdateChatIsPinned(Object):
"""
A chat was pinned or unpinned
Attributes:
ID (:obj:`str`): ``UpdateChatIsPinned``
Args:
chat_id (:obj:`int`):
Chat identifier
is_pinned (:obj:`bool`):
New value of is_p... | from ..utils import Object
class UpdateChatIsPinned(Object):
"""
A chat was pinned or unpinned
Attributes:
ID (:obj:`str`): ``UpdateChatIsPinned``
Args:
chat_id (:obj:`int`):
Chat identifier
is_pinned (:obj:`bool`):
New value of is_pinned
or... | en | 0.571586 | A chat was pinned or unpinned Attributes: ID (:obj:`str`): ``UpdateChatIsPinned`` Args: chat_id (:obj:`int`): Chat identifier is_pinned (:obj:`bool`): New value of is_pinned order (:obj:`int`): New value of the chat order Returns: ... | 2.850295 | 3 |
tests/test_api.py | jairhenrique/todoist-python | 0 | 6898 | import io
import time
import todoist
def test_stats_get(api_endpoint, api_token):
api = todoist.api.TodoistAPI(api_token, api_endpoint)
response = api.completed.get_stats()
assert 'days_items' in response
assert 'week_items' in response
assert 'karma_trend' in response
assert 'karma_last_upda... | import io
import time
import todoist
def test_stats_get(api_endpoint, api_token):
api = todoist.api.TodoistAPI(api_token, api_endpoint)
response = api.completed.get_stats()
assert 'days_items' in response
assert 'week_items' in response
assert 'karma_trend' in response
assert 'karma_last_upda... | none | 1 | 2.14649 | 2 | |
setup.py | dylancrockett/iot.io | 0 | 6899 | from setuptools import setup
import iotio
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name="iot.io",
version=iotio.__version__,
packages=["iotio"],
author="<NAME>",
author_email="<EMAIL>",
license="MIT",
description="A management API for connecting and managi... | from setuptools import setup
import iotio
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name="iot.io",
version=iotio.__version__,
packages=["iotio"],
author="<NAME>",
author_email="<EMAIL>",
license="MIT",
description="A management API for connecting and managi... | none | 1 | 1.53723 | 2 |