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 |
|---|---|---|---|---|---|---|---|---|---|---|
geo2_pipeline/preproc8/30_tokenize/pytok.py | brendano/twitter_geo_preproc | 4 | 6626951 | <gh_stars>1-10
# Used for experiment, not actually used in pipeline
import sys,json
from nlp import twokenize
for line in sys.stdin:
tweet = json.loads(line.split('\t')[-1])
print u' '.join(twokenize.tokenize(tweet['text'])).encode('utf8')
| # Used for experiment, not actually used in pipeline
import sys,json
from nlp import twokenize
for line in sys.stdin:
tweet = json.loads(line.split('\t')[-1])
print u' '.join(twokenize.tokenize(tweet['text'])).encode('utf8') | en | 0.865536 | # Used for experiment, not actually used in pipeline | 2.872611 | 3 |
cray/modules/aprun/cli.py | Cray-HPE/craycli | 1 | 6626952 | """
cli.py - aprun PALS CLI
MIT License
(C) Copyright [2020-2022] Hewlett Packard Enterprise Development LP
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... | """
cli.py - aprun PALS CLI
MIT License
(C) Copyright [2020-2022] Hewlett Packard Enterprise Development LP
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... | en | 0.704792 | cli.py - aprun PALS CLI MIT License (C) Copyright [2020-2022] Hewlett Packard Enterprise Development LP 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 lim... | 2.154513 | 2 |
design_pattern/creational/abstract_factory-example1/__version__.py | kannandreams/python-advance-concepts | 2 | 6626953 | VERSION = (0,1,1)
__version__ = '.'.join(map(str, VERSION)) | VERSION = (0,1,1)
__version__ = '.'.join(map(str, VERSION)) | none | 1 | 1.71085 | 2 | |
src/spyd/punitive_effects/punitive_model.py | DanSeraf/spyd | 0 | 6626954 | <gh_stars>0
from spyd.utils.net import dottedQuadToLong, simpleMaskedIpToLongIpAndMask
class PunitiveModel(object):
# effect_type: {mask: {masked_ip: effect_info}}
punitive_effects = {}
def __init__(self):
self.clear_effects()
def clear_effects(self, effect_type=None):
if effect_type... | from spyd.utils.net import dottedQuadToLong, simpleMaskedIpToLongIpAndMask
class PunitiveModel(object):
# effect_type: {mask: {masked_ip: effect_info}}
punitive_effects = {}
def __init__(self):
self.clear_effects()
def clear_effects(self, effect_type=None):
if effect_type is None:
... | en | 0.866416 | # effect_type: {mask: {masked_ip: effect_info}} | 2.261188 | 2 |
ingestion/src/metadata/ingestion/api/sink.py | rongfengliang/OpenMetadata | 0 | 6626955 | <gh_stars>0
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); ... | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not ... | en | 0.857232 | # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not ... | 2.00289 | 2 |
aki/aki.py | Obi-Wan3/phen-cogs | 0 | 6626956 | """
MIT License
Copyright (c) 2020-2021 phenom4n4n
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, publis... | """
MIT License
Copyright (c) 2020-2021 phenom4n4n
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, publis... | en | 0.759501 | MIT License Copyright (c) 2020-2021 phenom4n4n 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, d... | 1.873701 | 2 |
blender/arm/logicnode/animation/LN_on_action_marker.py | onelsonic/armory | 2,583 | 6626957 | <reponame>onelsonic/armory<filename>blender/arm/logicnode/animation/LN_on_action_marker.py<gh_stars>1000+
from arm.logicnode.arm_nodes import *
class OnActionMarkerNode(ArmLogicTreeNode):
"""Activates the output when the object action reaches the action marker."""
bl_idname = 'LNOnActionMarkerNode'
bl_labe... | from arm.logicnode.arm_nodes import *
class OnActionMarkerNode(ArmLogicTreeNode):
"""Activates the output when the object action reaches the action marker."""
bl_idname = 'LNOnActionMarkerNode'
bl_label = 'On Action Marker'
arm_version = 1
def arm_init(self, context):
self.add_input('ArmNo... | en | 0.462204 | Activates the output when the object action reaches the action marker. | 2.528273 | 3 |
SciComputing with Python/lesson_04-24/2-integral.py | evtodorov/aerospace | 0 | 6626958 | <reponame>evtodorov/aerospace
import math
print "*** Integration of exp(-x^2)dx from xmin to xmax ***"
xmin = input("Choose lower boundary: ")
xmax = input("Choose upper boundary: ")
n = input("Choose the number of subintervals: ")
s = 0
sup = 0
sd= 0
x = float(xmin)
dx = (xmax-xmin)/float(n)
while (x<xmax-dx):
s +... | import math
print "*** Integration of exp(-x^2)dx from xmin to xmax ***"
xmin = input("Choose lower boundary: ")
xmax = input("Choose upper boundary: ")
n = input("Choose the number of subintervals: ")
s = 0
sup = 0
sd= 0
x = float(xmin)
dx = (xmax-xmin)/float(n)
while (x<xmax-dx):
s += math.exp(-(x+dx/2.)**2) #... | en | 0.430996 | #midpoint #endpoint #startpoint | 4.072887 | 4 |
k-saap_pkg/src/auctioneer.py | joaoquintas/auction_methods_stack | 2 | 6626959 | # configuring PYTHONPATH (By default, this will add the src and lib directory for each of your dependencies to your PYTHONPATH)
import roslib; roslib.load_manifest('k-saap_pkg')
# import client library
import rospy
# import messages
import auction_msgs.msg
# import services
import auction_srvs.srv
# import services... | # configuring PYTHONPATH (By default, this will add the src and lib directory for each of your dependencies to your PYTHONPATH)
import roslib; roslib.load_manifest('k-saap_pkg')
# import client library
import rospy
# import messages
import auction_msgs.msg
# import services
import auction_srvs.srv
# import services... | en | 0.55165 | # configuring PYTHONPATH (By default, this will add the src and lib directory for each of your dependencies to your PYTHONPATH) # import client library # import messages # import services # import services functions # import auxiliar libraries # "global" variables (to be referred as global under def fun(something)) ###... | 2.270768 | 2 |
train_iqn.py | robinzixuan/IQN_Agent | 0 | 6626960 | <reponame>robinzixuan/IQN_Agent
import os
import yaml
import argparse
from datetime import datetime
from fqf_iqn_qrdqn.env import make_pytorch_env
from fqf_iqn_qrdqn.agent import IQNAgent
def run(args):
with open(args.config) as f:
config = yaml.load(f, Loader=yaml.SafeLoader)
# Create environments.... | import os
import yaml
import argparse
from datetime import datetime
from fqf_iqn_qrdqn.env import make_pytorch_env
from fqf_iqn_qrdqn.agent import IQNAgent
def run(args):
with open(args.config) as f:
config = yaml.load(f, Loader=yaml.SafeLoader)
# Create environments.
env = make_pytorch_env(args... | en | 0.725798 | # Create environments. # Specify the directory to log. # Create the agent and run. # load model # | 2.230283 | 2 |
run_utils/callbacks/base.py | shikhar-srivastava/hover_net | 0 | 6626961 | <reponame>shikhar-srivastava/hover_net
import operator
import json
import pickle
import cv2
import matplotlib.pyplot as plt
import numpy as np
import torch
from misc.utils import center_pad_to_shape, cropping_center
from scipy.stats import mode as major_value
from sklearn.metrics import confusion_matrix
####
class B... | import operator
import json
import pickle
import cv2
import matplotlib.pyplot as plt
import numpy as np
import torch
from misc.utils import center_pad_to_shape, cropping_center
from scipy.stats import mode as major_value
from sklearn.metrics import confusion_matrix
####
class BaseCallbacks(object):
def __init__(... | en | 0.711024 | #### #### Add learning rate to tracking # logging learning rate, decouple into another callback? #### Trigger all scheduler. # logging learning rate, decouple into another callback? #### #### Must declare save dir first in the shared global state of the attached engine. # TODO: add switch so that only one of [per_n_epo... | 2.252367 | 2 |
client/controller/autenticate.py | jurandirjdsilva/pycryptomail | 1 | 6626962 | <gh_stars>1-10
from client.data.message import Message
class Authentication:
def __init__(self):
self.user_token = None
self.user_name = None
def request_authentication(self, email, password):
msg = Message.msg_autentication(email, password)
def connect(self):
pass
| from client.data.message import Message
class Authentication:
def __init__(self):
self.user_token = None
self.user_name = None
def request_authentication(self, email, password):
msg = Message.msg_autentication(email, password)
def connect(self):
pass | none | 1 | 2.571547 | 3 | |
tests/test_iland.py | jefftp/python-sdk | 5 | 6626963 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import time
import unittest
import iland
import requests_mock
BASE_URL = 'http://example.com/ecs'
VALID_TOKEN_PAYLOAD = {'expires_in': 12,
'refresh_expires_in': 17,
'access_token': '<PASSWORD>',
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import time
import unittest
import iland
import requests_mock
BASE_URL = 'http://example.com/ecs'
VALID_TOKEN_PAYLOAD = {'expires_in': 12,
'refresh_expires_in': 17,
'access_token': '<PASSWORD>',
... | en | 0.825432 | #!/usr/bin/env python # -*- coding: utf-8 -*- # manually refresh token # still the same since not expired therefore not renewed # let's wait for expiration # manually remove the actual token so that we refetch an access # token # wait for access token expiration. since the refresh endpoint # returns a 400, we expect th... | 2.69646 | 3 |
tests/helpers/test_entity_component.py | billyburly/home-assistant | 5 | 6626964 | """The tests for the Entity component helper."""
# pylint: disable=protected-access
from collections import OrderedDict
from datetime import timedelta
import logging
from unittest.mock import Mock, patch
import asynctest
import pytest
from homeassistant.const import ENTITY_MATCH_ALL
import homeassistant.core as ha
fr... | """The tests for the Entity component helper."""
# pylint: disable=protected-access
from collections import OrderedDict
from datetime import timedelta
import logging
from unittest.mock import Mock, patch
import asynctest
import pytest
from homeassistant.const import ENTITY_MATCH_ALL
import homeassistant.core as ha
fr... | en | 0.85727 | The tests for the Entity component helper. # pylint: disable=protected-access Test the loading of the platforms. # mock the dependencies Test the setup if exceptions are happening. Test setup for discovery. Test the setting of the scan interval via configuration. Test the platform setup. Test setting an entity namespac... | 2.212576 | 2 |
lib/galaxy/visualization/plugins/resource_parser.py | rikeshi/galaxy | 4 | 6626965 | <gh_stars>1-10
"""
Deserialize Galaxy resources (hdas, ldas, datasets, genomes, etc.) from
a dictionary of string data/ids (often from a query string).
"""
import json
import logging
import weakref
import galaxy.exceptions
import galaxy.util
from galaxy.managers import (
hdas as hda_manager,
visualizations as ... | """
Deserialize Galaxy resources (hdas, ldas, datasets, genomes, etc.) from
a dictionary of string data/ids (often from a query string).
"""
import json
import logging
import weakref
import galaxy.exceptions
import galaxy.util
from galaxy.managers import (
hdas as hda_manager,
visualizations as visualization_m... | en | 0.724391 | Deserialize Galaxy resources (hdas, ldas, datasets, genomes, etc.) from a dictionary of string data/ids (often from a query string). Given a parameter dictionary (often a converted query string) and a configuration dictionary (curr. only VisualizationsRegistry uses this), convert the entries in the parameter di... | 2.849273 | 3 |
convert/convert_nest_flax.py | wenh18/OnDeviceNAS | 1 | 6626966 | <reponame>wenh18/OnDeviceNAS<filename>convert/convert_nest_flax.py
"""
Convert weights from https://github.com/google-research/nested-transformer
NOTE: You'll need https://github.com/google/CommonLoopUtils, not included in requirements.txt
"""
import sys
import numpy as np
import torch
from clu import checkpoint
a... | """
Convert weights from https://github.com/google-research/nested-transformer
NOTE: You'll need https://github.com/google/CommonLoopUtils, not included in requirements.txt
"""
import sys
import numpy as np
import torch
from clu import checkpoint
arch_depths = {
'nest_base': [2, 2, 20],
'nest_small': [2, 2... | en | 0.799573 | Convert weights from https://github.com/google-research/nested-transformer NOTE: You'll need https://github.com/google/CommonLoopUtils, not included in requirements.txt Expects path to checkpoint which is a dir containing 4 files like in each of these folders - https://console.cloud.google.com/storage/browser/g... | 2.310481 | 2 |
TorchMLP/mlp.py | euirim/fundraising-propensity | 0 | 6626967 | import torch
from torch.utils.data import IterableDataset, DataLoader
import csv
import torch.nn.functional as F
LOG_FILE = 'logs.txt'
FILENAME = 'full_dataset_bert_title_doc2vec_story.csv'
NUM_CATEGORIES = 19
IGNORE_COLS = ['url', 'story', 'title', 'first_cover_image', 'story_images']
Y_COLS = ['raised']
NUM_TEST = 3... | import torch
from torch.utils.data import IterableDataset, DataLoader
import csv
import torch.nn.functional as F
LOG_FILE = 'logs.txt'
FILENAME = 'full_dataset_bert_title_doc2vec_story.csv'
NUM_CATEGORIES = 19
IGNORE_COLS = ['url', 'story', 'title', 'first_cover_image', 'story_images']
Y_COLS = ['raised']
NUM_TEST = 3... | none | 1 | 2.849447 | 3 | |
tests/unit/test_availability_check.py | tbicr/sites-availability-checker | 0 | 6626968 | from datetime import datetime
import httpx
import pytest
from service.utils import fetch, regexp_check
@pytest.mark.asyncio
async def test_fetch__ok(httpx_mock):
httpx_mock.add_response(status_code=200, data=b"ok")
async with httpx.AsyncClient() as client:
check_result, content = await fetch(client,... | from datetime import datetime
import httpx
import pytest
from service.utils import fetch, regexp_check
@pytest.mark.asyncio
async def test_fetch__ok(httpx_mock):
httpx_mock.add_response(status_code=200, data=b"ok")
async with httpx.AsyncClient() as client:
check_result, content = await fetch(client,... | none | 1 | 2.425895 | 2 | |
gnsstools/galileo/e5aq.py | wumouyan/GNSS-SDR-Python | 68 | 6626969 | <filename>gnsstools/galileo/e5aq.py
# Galileo E5a-Q code construction
#
# Copyright 2014 <NAME>
import numpy as np
chip_rate = 10230000
code_length = 10230
# secondary code table from Table 19 (page 18) of Galileo ICD SIS (2014)
# index is PRN
secondary_code = {
1: '83F6F69D8F6E15411FB8C9B1C', 2: '66558BD3CE0C7... | <filename>gnsstools/galileo/e5aq.py
# Galileo E5a-Q code construction
#
# Copyright 2014 <NAME>
import numpy as np
chip_rate = 10230000
code_length = 10230
# secondary code table from Table 19 (page 18) of Galileo ICD SIS (2014)
# index is PRN
secondary_code = {
1: '83F6F69D8F6E15411FB8C9B1C', 2: '66558BD3CE0C7... | en | 0.611792 | # Galileo E5a-Q code construction # # Copyright 2014 <NAME> # secondary code table from Table 19 (page 18) of Galileo ICD SIS (2014) # index is PRN # parse the hex string, return a 100-bit secondary-code array # transform the secondary-code table entries to sequences # initial-state table from Table 16 (page 15) of Gal... | 1.924432 | 2 |
solutions/100_solution_05.py | UFResearchComputing/py4ai | 0 | 6626970 | sum = 0
data = [1,2,2,5]
cumulative = []
for number in data:
sum += number
cumulative.append(sum)
print(cumulative) | sum = 0
data = [1,2,2,5]
cumulative = []
for number in data:
sum += number
cumulative.append(sum)
print(cumulative) | none | 1 | 3.61978 | 4 | |
auxiliary/aux_m/test_problems_info.py | OpenSourceEconomics/ose-scientific-computing-course-wirecard | 0 | 6626971 | <filename>auxiliary/aux_m/test_problems_info.py<gh_stars>0
from numpy import *
import pandas as pd
import random
import nlopt
import numpy as np
import matplotlib.pyplot as plt
import numbers
import math
import random
import autograd.numpy as ag
from autograd import grad
from mpl_toolkits.mplot3d import Axes3D
from num... | <filename>auxiliary/aux_m/test_problems_info.py<gh_stars>0
from numpy import *
import pandas as pd
import random
import nlopt
import numpy as np
import matplotlib.pyplot as plt
import numbers
import math
import random
import autograd.numpy as ag
from autograd import grad
from mpl_toolkits.mplot3d import Axes3D
from num... | en | 0.5524 | #### this file contains classes which store general information about a test problem as for example optimum, domain, upper bound #### lower bound, function value of optimum, name of test problem ##### This class stores the general information for a griewank function ### arguments are the number of dimensions of the pro... | 2.863977 | 3 |
irekua_database/models/terms/synonyms.py | CONABIO-audio/irekua-database | 0 | 6626972 | <gh_stars>0
from django.db.models import JSONField
from django.db import models
from django.core.exceptions import ValidationError
from django.utils.translation import gettext_lazy as _
from irekua_database.utils import empty_JSON
from irekua_database.models import base
class Synonym(base.IrekuaModelBase):
sourc... | from django.db.models import JSONField
from django.db import models
from django.core.exceptions import ValidationError
from django.utils.translation import gettext_lazy as _
from irekua_database.utils import empty_JSON
from irekua_database.models import base
class Synonym(base.IrekuaModelBase):
source = models.F... | none | 1 | 2.03576 | 2 | |
SprityBird/spritybird/python3.5/lib/python3.5/site-packages/tables/tests/test_create.py | MobileAnalytics/iPython-Framework | 4 | 6626973 | <reponame>MobileAnalytics/iPython-Framework<gh_stars>1-10
# -*- coding: utf-8 -*-
"""This test unit checks object creation funtions, like open_file,
create_table, create_array or create_group.
It also checks:
- name identifiers in tree objects
- title character limit for objects (255)
- limit in number in table fiel... | # -*- coding: utf-8 -*-
"""This test unit checks object creation funtions, like open_file,
create_table, create_array or create_group.
It also checks:
- name identifiers in tree objects
- title character limit for objects (255)
- limit in number in table fields (255)
"""
from __future__ import print_function
from ... | en | 0.801765 | # -*- coding: utf-8 -*- This test unit checks object creation funtions, like open_file, create_table, create_array or create_group. It also checks: - name identifiers in tree objects - title character limit for objects (255) - limit in number in table fields (255) # 4-character String # integer # short integer # doub... | 2.483591 | 2 |
app/business/globus_client.py | justincc/RDSDS-Server | 0 | 6626974 | <gh_stars>0
from globus_sdk import ConfidentialAppAuthClient
import logging
from app.core.config import GLOBUS_CLIENT_ID, GLOBUS_CLIENT_SECRET
class GlobusClient:
client: ConfidentialAppAuthClient = None
globus = GlobusClient()
def load_app_client():
globus.client = ConfidentialAppAuthClient(
GLOBUS... | from globus_sdk import ConfidentialAppAuthClient
import logging
from app.core.config import GLOBUS_CLIENT_ID, GLOBUS_CLIENT_SECRET
class GlobusClient:
client: ConfidentialAppAuthClient = None
globus = GlobusClient()
def load_app_client():
globus.client = ConfidentialAppAuthClient(
GLOBUS_CLIENT_ID, ... | none | 1 | 1.822167 | 2 | |
topcoder/update_topcoder_readme.py | 0x8b/HackerRank | 3 | 6626975 | #!/usr/bin/env python
import json
from operator import itemgetter
from pathlib import Path
with open("data.json", "r") as f:
data = json.load(f)
links = {
problem["name"]: problem["desc"]
for problems in data.values()
for problem in problems
}
languages = {
"py": "Python",
"rs": "Rust",
}
w... | #!/usr/bin/env python
import json
from operator import itemgetter
from pathlib import Path
with open("data.json", "r") as f:
data = json.load(f)
links = {
problem["name"]: problem["desc"]
for problems in data.values()
for problem in problems
}
languages = {
"py": "Python",
"rs": "Rust",
}
w... | es | 0.111254 | #!/usr/bin/env python ## {category}\n\n") | 2.951359 | 3 |
e2emlstorlets/tools/swift_access.py | eranr/e2emlstorlets | 0 | 6626976 | # Copyright (c) 2010-2016 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 agree... | # Copyright (c) 2010-2016 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 agree... | en | 0.787364 | # Copyright (c) 2010-2016 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 agree... | 2.178715 | 2 |
thingsGate/odoo/gate.py | lubusax/2005_thingsGate | 0 | 6626977 | <gh_stars>0
import requests, json, logging
from internet.internet import internetAccess,getInternet
class Gate:
def __init__(self,dirPath):
self.dirPath = dirPath
self.thingsGateFilePath = self.dirPath+'/data/thingsGate.json'
self.setParams()
logging.debug("Gate Class Initialized")
def setParams(... | import requests, json, logging
from internet.internet import internetAccess,getInternet
class Gate:
def __init__(self,dirPath):
self.dirPath = dirPath
self.thingsGateFilePath = self.dirPath+'/data/thingsGate.json'
self.setParams()
logging.debug("Gate Class Initialized")
def setParams(self):
l... | en | 0.163062 | # self.db = self.thingsGateDict["db"][0] # self.user = self.thingsGateDict["user_name"][0] # self.pswd = self.thingsGateDict["user_password"][0] # self.host = self.thingsGateDict["odoo_host"][0] # self.port = self.thingsGateDict["odoo_port"][0] # self.adm = self.thingsGateDict["admin_id"][0] # self.tz = self.thingsGate... | 2.54563 | 3 |
proj/hps_accel/gateware/gen2/test_macc.py | keadwen/CFU-Playground | 240 | 6626978 | <gh_stars>100-1000
#!/bin/env python
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | #!/bin/env python
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | en | 0.780568 | #!/bin/env python # Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agre... | 2.440178 | 2 |
youtube_dl/extractor/springboardplatform.py | hackarada/youtube-dl | 66,635 | 6626979 | <reponame>hackarada/youtube-dl
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
int_or_none,
xpath_attr,
xpath_text,
xpath_element,
unescapeHTML,
unified_timestamp,
)
class SpringboardPlatformIE(Info... | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
int_or_none,
xpath_attr,
xpath_text,
xpath_element,
unescapeHTML,
unified_timestamp,
)
class SpringboardPlatformIE(InfoExtractor):
_VALID_URL = r'... | en | 0.39914 | # coding: utf-8 (?x) https?:// cms\.springboardplatform\.com/ (?: (?:previews|embed_iframe)/(?P<index>\d+)/video/(?P<id>\d+)| xml_feeds_advanced/index/(?P<index_2>\d+)/rss3/(?P<id_2>\d+) ... | 2.017697 | 2 |
tests/macro/scripts/lapack/runtest_dgbtrf.py | dina-fouad/pyccel | 206 | 6626980 | # pylint: disable=missing-function-docstring, missing-module-docstring, undefined-variable, unused-import
from numpy import zeros
from pyccel.stdlib.internal.lapack import dgbtrf
if __name__ == '__main__':
n = 25
ml = 1
mu = 1
lda = 2 * ml + mu + 1
a = zeros((lda,n), dtype = 'double',order = '... | # pylint: disable=missing-function-docstring, missing-module-docstring, undefined-variable, unused-import
from numpy import zeros
from pyccel.stdlib.internal.lapack import dgbtrf
if __name__ == '__main__':
n = 25
ml = 1
mu = 1
lda = 2 * ml + mu + 1
a = zeros((lda,n), dtype = 'double',order = '... | en | 0.415443 | # pylint: disable=missing-function-docstring, missing-module-docstring, undefined-variable, unused-import # Superdiagonal, Diagonal, Subdiagonal #$ header macro (ab(:,:), ipiv(ab.shape[0]), info), dgbtrf_v1(ab, kl, ku, m=ab.shape[1], n=ab.shape[1], ldab=ab.shape[0]) := dgbtrf(m, n, kl, ku, ab, ldab, ipiv, info) | 2.120912 | 2 |
pioneer/core/traj_predict.py | TJUMMG/TGSR | 0 | 6626981 | <reponame>TJUMMG/TGSR
import torch
import torch.nn as nn
import numpy as np
from torch.utils.data import DataLoader, Dataset
import os
import warnings
from pioneer.core.STLSTM import STLSTM
class Predict_FC(nn.Module):
def __init__(self):
super(Predict_FC, self).__init__()
self.pred_cx = torch.nn.... | import torch
import torch.nn as nn
import numpy as np
from torch.utils.data import DataLoader, Dataset
import os
import warnings
from pioneer.core.STLSTM import STLSTM
class Predict_FC(nn.Module):
def __init__(self):
super(Predict_FC, self).__init__()
self.pred_cx = torch.nn.Sequential(
... | en | 0.353251 | :param center_post: [BatchSize, Seq_len, 6] (cx,cy,vx,vy,gtw,gth) :return: [cx,cy] :param center_post: [BatchSize, Seq_len, 6] (cx,cy,vx,vy,gtw,gth) :return: [cx,cy] :param center_post: [BatchSize, Seq_len, 6] (cx,cy,vx,vy,gtw,gth) :return: [cx,cy] :param center_post: [BatchSize, Seq_len, 6] ... | 2.476996 | 2 |
server.py | MasahiroYoshida/network-app-layer | 0 | 6626982 | <gh_stars>0
#!/usr/bin/python
import socket, optparse
import threading
from os import listdir, fork
from message import Message
import time
q = ['first item']
def handle_controller_connection(controller_socket):
request = controller_socket.recv(1024)
print('Controller: {}\n'.format(request))
contents = [f... | #!/usr/bin/python
import socket, optparse
import threading
from os import listdir, fork
from message import Message
import time
q = ['first item']
def handle_controller_connection(controller_socket):
request = controller_socket.recv(1024)
print('Controller: {}\n'.format(request))
contents = [file for file... | en | 0.702655 | #!/usr/bin/python #PLAY #STOP #RESUME # max backlog of connections # max backlog of connections | 2.612851 | 3 |
pythonProject/03al52funncao_def2/funcao+def_3.py | D-Wolter/PycharmProjects | 0 | 6626983 |
def divisao(n1 , n2):
if n2 > 0:
return n1 / n2
divide = divisao(8, 2)
if divide:
print(divide)
else:
print('conta invalida') |
def divisao(n1 , n2):
if n2 > 0:
return n1 / n2
divide = divisao(8, 2)
if divide:
print(divide)
else:
print('conta invalida') | none | 1 | 3.984413 | 4 | |
amrlib/models/parse_gsii/graph_builder.py | MeghaTiya/amrlib | 103 | 6626984 | import penman
import re
from collections import Counter, defaultdict
from types import SimpleNamespace
import numpy as np
from .amr_graph import _is_attr_form, need_an_instance
# Note that penman triples typically have a colon in front of the relationship but
# it appears to add these automatically when creatin... | import penman
import re
from collections import Counter, defaultdict
from types import SimpleNamespace
import numpy as np
from .amr_graph import _is_attr_form, need_an_instance
# Note that penman triples typically have a colon in front of the relationship but
# it appears to add these automatically when creatin... | en | 0.876286 | # Note that penman triples typically have a colon in front of the relationship but # it appears to add these automatically when creating the graph. # List of node names (concets and attributes) # list of (target_id, source_id, arc_prob, rel_prob:list(vocab)) # names for concepts (1:1) ie.. n1, n2, p1, Ohio@attr4@ , ..... | 2.888338 | 3 |
cogs/moderation.py | Skullknight011/Cyanmaton | 1 | 6626985 | <filename>cogs/moderation.py
import discord
from discord.ext import commands
import os
import requests
import json
import time
from math import *
import time
import asyncio
from datetime import datetime
import dateparser
client = discord.Client()
class ModerationCog(commands.Cog):
def __init__(self, bot):
... | <filename>cogs/moderation.py
import discord
from discord.ext import commands
import os
import requests
import json
import time
from math import *
import time
import asyncio
from datetime import datetime
import dateparser
client = discord.Client()
class ModerationCog(commands.Cog):
def __init__(self, bot):
... | none | 1 | 2.499318 | 2 | |
notebooks/regression/bbp_homo_ccpp.py | Neronjust2017/Bayesian-neural-networks | 4 | 6626986 | <reponame>Neronjust2017/Bayesian-neural-networks
# %%
import GPy
import time
import copy
import math
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from torchvision import datasets, transfor... | # %%
import GPy
import time
import copy
import math
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from torchvision import datasets, transforms
from torchvision.utils import make_grid
from t... | en | 0.416016 | # %% # %% # %% # %% # %% # sample gaussian noise for each weight and each bias # calculate the weight and bias stds from the rho parameters # calculate samples from the posterior from the sampled noise and mus/stds # computing the KL loss term # return output, KL_loss # sample gaussian noise for each weight and each bi... | 2.173267 | 2 |
maintainers/scripts/update.py | aidalgol/nixpkgs | 2 | 6626987 | <reponame>aidalgol/nixpkgs
from __future__ import annotations
from typing import Dict, Generator, List, Optional, Tuple
import argparse
import asyncio
import contextlib
import json
import os
import re
import subprocess
import sys
import tempfile
class CalledProcessError(Exception):
process: asyncio.subprocess.Proc... | from __future__ import annotations
from typing import Dict, Generator, List, Optional, Tuple
import argparse
import asyncio
import contextlib
import json
import os
import re
import subprocess
import sys
import tempfile
class CalledProcessError(Exception):
process: asyncio.subprocess.Process
def eprint(*args, **kw... | en | 0.83892 | Emulate check argument of subprocess.run function. # Ensure the worktree is clean before update. # Update scripts can use $(dirname $0) to get their location but we want to run # their clones in the git worktree, not in the main nixpkgs repo. # Git can only handle a single index operation at a time # Try to fill in mis... | 2.307205 | 2 |
src/tests/test_normalize.py | Shashvatb/pythia | 84 | 6626988 | import py.test
from src.utils import normalize
import subprocess
import os
'''
TEST FROM PYTHIA
'''
def test_empty_string():
assert normalize.normalize_and_remove_stop_words("") == ""
def test_links():
assert normalize.remove_links("my link is <http://link.com>") == "my link is <http:>"
def test_HTML():
... | import py.test
from src.utils import normalize
import subprocess
import os
'''
TEST FROM PYTHIA
'''
def test_empty_string():
assert normalize.normalize_and_remove_stop_words("") == ""
def test_links():
assert normalize.remove_links("my link is <http://link.com>") == "my link is <http:>"
def test_HTML():
... | en | 0.39053 | TEST FROM PYTHIA | 2.84235 | 3 |
multi_agent_sac/src/multi_agent_sac/test.py | redvinaa/multiagent-path-finding-continuous | 0 | 6626989 | #! /usr/bin/env python3.6
import argparse
import torch
import os
import numpy as np
from multi_agent_sac.algorithm import MASAC
from multi_agent_sac.misc import from_unit_actions
from multi_agent_sac.env_wrapper import ParallelEnv
from rospkg import RosPack
import json
class TestMASACRos:
def __init__(self, conf... | #! /usr/bin/env python3.6
import argparse
import torch
import os
import numpy as np
from multi_agent_sac.algorithm import MASAC
from multi_agent_sac.misc import from_unit_actions
from multi_agent_sac.env_wrapper import ParallelEnv
from rospkg import RosPack
import json
class TestMASACRos:
def __init__(self, conf... | en | 0.638332 | #! /usr/bin/env python3.6 # load config # seed from config file # create env # create model, load weights # most of these are not used # get actions # render # step | 1.864146 | 2 |
graphics/dotplot.py | yanxueqing621/jcvi | 1 | 6626990 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
%prog [anchorfile|ksfile] --qbed query.bed --sbed subject.bed
visualize the anchorfile in a dotplot. anchorfile contains two columns
indicating gene pairs, followed by an optional column (e.g. Ks value).
The option --colormap specifies the block color to highlight ce... | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
%prog [anchorfile|ksfile] --qbed query.bed --sbed subject.bed
visualize the anchorfile in a dotplot. anchorfile contains two columns
indicating gene pairs, followed by an optional column (e.g. Ks value).
The option --colormap specifies the block color to highlight ce... | en | 0.592183 | #!/usr/bin/env python # -*- coding: UTF-8 -*- %prog [anchorfile|ksfile] --qbed query.bed --sbed subject.bed visualize the anchorfile in a dotplot. anchorfile contains two columns indicating gene pairs, followed by an optional column (e.g. Ks value). The option --colormap specifies the block color to highlight certain... | 2.80923 | 3 |
core.py | gizemiskender/MalwareDetector | 43 | 6626991 | from androguard.core.bytecodes.dvm import DalvikVMFormat
from androguard.core.analysis.analysis import VMAnalysis
from androguard.decompiler.decompiler import DecompilerDAD
from androguard.core.bytecodes.apk import APK
from androguard.core.analysis import analysis
from androguard.core.bytecodes import dvm
from constant... | from androguard.core.bytecodes.dvm import DalvikVMFormat
from androguard.core.analysis.analysis import VMAnalysis
from androguard.decompiler.decompiler import DecompilerDAD
from androguard.core.bytecodes.apk import APK
from androguard.core.analysis import analysis
from androguard.core.bytecodes import dvm
from constant... | en | 0.420202 | # apk_vector.extend(apk['feature_vectors']['others']) # feature_vector.extend(apk['feature_vectors']['others']) | 1.999262 | 2 |
tutorials/12_NAS_LSTM/dh_project/dh_project/lstm_search/search_space.py | sjiang87/tutorials | 0 | 6626992 | <reponame>sjiang87/tutorials
import collections
import tensorflow as tf
from deephyper.nas.space import KSearchSpace, AutoKSearchSpace
from deephyper.nas.space.node import ConstantNode, VariableNode
from deephyper.nas.space.op.basic import Tensor
from deephyper.nas.space.op.connect import Connect
from deephyper.nas.s... | import collections
import tensorflow as tf
from deephyper.nas.space import KSearchSpace, AutoKSearchSpace
from deephyper.nas.space.node import ConstantNode, VariableNode
from deephyper.nas.space.op.basic import Tensor
from deephyper.nas.space.op.connect import Connect
from deephyper.nas.space.op.merge import AddByPro... | en | 0.595036 | # we do not want to create a layer in this case # we do not want to create a layer in this case #activations = [None, tf.nn.relu, tf.nn.tanh, tf.nn.sigmoid] # we do not want to create a layer in this case #activations = [None, tf.nn.relu, tf.nn.tanh, tf.nn.sigmoid] # look over skip connections within a range of the 2 p... | 2.487682 | 2 |
hexmap/render.py | yogurt-company/gaia_ai | 0 | 6626993 | from abc import ABCMeta, abstractmethod
import pygame
import math
from hexmap.map import Grid, Map, MapUnit
import sys
SQRT3 = math.sqrt( 3 )
class Render( pygame.Surface, metaclass=ABCMeta ):
def __init__( self, map, radius=24, *args, **keywords ):
self.map = map
self.radius = radius
# Colors for th... | from abc import ABCMeta, abstractmethod
import pygame
import math
from hexmap.map import Grid, Map, MapUnit
import sys
SQRT3 = math.sqrt( 3 )
class Render( pygame.Surface, metaclass=ABCMeta ):
def __init__( self, map, radius=24, *args, **keywords ):
self.map = map
self.radius = radius
# Colors for th... | en | 0.837968 | # Colors for the map Returns a subsurface corresponding to the surface, hopefully with trim_cell wrapped around the blit method. # Draw methods An abstract base method for various render objects to call to paint themselves. If called via super, it fills the screen with the colorkey, if the colorkey is not set... | 3.552565 | 4 |
cinder/tests/unit/api/contrib/test_consistencygroups.py | potsmaster/cinder | 0 | 6626994 | <reponame>potsmaster/cinder<gh_stars>0
# Copyright (C) 2012 - 2014 EMC Corporation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apac... | # Copyright (C) 2012 - 2014 EMC Corporation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unle... | en | 0.831794 | # Copyright (C) 2012 - 2014 EMC Corporation. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unle... | 1.971326 | 2 |
build/lib/gains/adaptive.py | wesleybeckner/gains | 7 | 6626995 | <gh_stars>1-10
from math import sqrt
from scipy.spatial import ConvexHull
from sklearn.preprocessing import MinMaxScaler
from sklearn.neighbors import KernelDensity
import numpy as np
from os.path import dirname, join
import pandas as pd
from rdkit.Chem import AllChem as Chem
import re
import salty
from rdkit.ML.Descri... | from math import sqrt
from scipy.spatial import ConvexHull
from sklearn.preprocessing import MinMaxScaler
from sklearn.neighbors import KernelDensity
import numpy as np
from os.path import dirname, join
import pandas as pd
from rdkit.Chem import AllChem as Chem
import re
import salty
from rdkit.ML.Descriptors.MoleculeD... | en | 0.620833 | creates new qspr models using md data Parameters ---------- df : pandas DataFrame salt_log data from the genetic algorithm. Contains the headers 'Salt Smiles' and 'MD Calculation'. Current support is only for cpt and density property_to_model : str current support is for... | 2.559829 | 3 |
archeomagnetic_data/create_data_set.py | mingzhaochina/AH-RJMCMC | 1 | 6626996 | <reponame>mingzhaochina/AH-RJMCMC
import numpy as np
min_age = 1000.0
max_age = 2000.0
#
f = open('Lubeck.txt', 'r')
a=f.readline()
output = open('Lubeck_Paris700.txt', "w")
output.write('# Lubeck+Paris, age range ' + str(min_age)+ ' - ' + str(max_age) + ' Lat Long Age dt Int-Paris sd rep\n')
while 1:
... | import numpy as np
min_age = 1000.0
max_age = 2000.0
#
f = open('Lubeck.txt', 'r')
a=f.readline()
output = open('Lubeck_Paris700.txt', "w")
output.write('# Lubeck+Paris, age range ' + str(min_age)+ ' - ' + str(max_age) + ' Lat Long Age dt Int-Paris sd rep\n')
while 1:
a=f.readline()
if a=='': brea... | none | 1 | 3.087345 | 3 | |
tests/test_murmurhash2.py | messense/murmurhash2-py | 1 | 6626997 | <reponame>messense/murmurhash2-py
# -*- coding: utf-8 -*-
import pytest
from murmurhash2 import murmurhash2, murmurhash3
SEED = 3242157231
@pytest.mark.parametrize(
"key, expected",
[
("", 3632506080),
("a", 455683869),
("ab", 2448092234),
("abc", 2066295634),
("abc... | # -*- coding: utf-8 -*-
import pytest
from murmurhash2 import murmurhash2, murmurhash3
SEED = 3242157231
@pytest.mark.parametrize(
"key, expected",
[
("", 3632506080),
("a", 455683869),
("ab", 2448092234),
("abc", 2066295634),
("abcd", 2588571162),
("abcde",... | en | 0.769321 | # -*- coding: utf-8 -*- | 2.484738 | 2 |
succinctly/multi_class/crammer_singer.py | syncfusioncontent/Support-Vector-Machines-Succinctly | 59 | 6626998 | <reponame>syncfusioncontent/Support-Vector-Machines-Succinctly
from succinctly.multi_class import load_X, load_y
from sklearn.svm import LinearSVC
import numpy as np
X = load_X()
y = load_y()
clf = LinearSVC(C=1000, multi_class='crammer_singer')
clf.fit(X,y)
# Make predictions on two data points
X_to_predict = np.a... | from succinctly.multi_class import load_X, load_y
from sklearn.svm import LinearSVC
import numpy as np
X = load_X()
y = load_y()
clf = LinearSVC(C=1000, multi_class='crammer_singer')
clf.fit(X,y)
# Make predictions on two data points
X_to_predict = np.array([[5,5],[2,5]])
print(clf.predict(X_to_predict)) # prints [... | en | 0.727178 | # Make predictions on two data points # prints [4 1] | 3.018105 | 3 |
fuzzing_cli/fuzz/ide/truffle.py | ConsenSys/diligence-fuzzing | 8 | 6626999 | <filename>fuzzing_cli/fuzz/ide/truffle.py
import json
from os.path import abspath
from pathlib import Path
from subprocess import Popen, TimeoutExpired
from tempfile import TemporaryFile
from typing import Any, Dict, List
from fuzzing_cli.fuzz.exceptions import BuildArtifactsError
from fuzzing_cli.fuzz.ide.generic imp... | <filename>fuzzing_cli/fuzz/ide/truffle.py
import json
from os.path import abspath
from pathlib import Path
from subprocess import Popen, TimeoutExpired
from tempfile import TemporaryFile
from typing import Any, Dict, List
from fuzzing_cli.fuzz.exceptions import BuildArtifactsError
from fuzzing_cli.fuzz.ide.generic imp... | en | 0.800508 | # targets could be specified using relative path. But sourcePath in truffle artifacts # will use absolute paths, so we need to use absolute paths in targets as well # We get the build items from truffle and rename them into the properties used by the FaaS # We can select any dict on the build_files_by_source_file[sourc... | 2.069638 | 2 |
contact/views.py | robtagg/django-contact | 0 | 6627000 | from django.conf import settings
from django.shortcuts import redirect, render
from django.urls import reverse_lazy
from . import forms
def index(request):
"""
Main contact message view
"""
form = forms.ContactForm(data=request.POST or None)
if form.is_valid():
form.process(ip_address=re... | from django.conf import settings
from django.shortcuts import redirect, render
from django.urls import reverse_lazy
from . import forms
def index(request):
"""
Main contact message view
"""
form = forms.ContactForm(data=request.POST or None)
if form.is_valid():
form.process(ip_address=re... | en | 0.441959 | Main contact message view | 1.96772 | 2 |
participant/queryset.py | Arpit8081/Phishtray_Edited_Version | 2 | 6627001 | from django.apps import apps
from django.db.models import QuerySet
from users.models import User
class ParticipantQuerySet(QuerySet):
def filter_by_user(self, user):
from .models import Organization
if not user or not isinstance(user, User):
return self.none()
if not user.is_... | from django.apps import apps
from django.db.models import QuerySet
from users.models import User
class ParticipantQuerySet(QuerySet):
def filter_by_user(self, user):
from .models import Organization
if not user or not isinstance(user, User):
return self.none()
if not user.is_... | none | 1 | 2.233503 | 2 | |
examples/amplpy/simplest_examples/netflow.py | adampkehoe/ticdat | 15 | 6627002 | # Simplest multi-commodity flow example using amplpy and ticdat
from ticdat import PanDatFactory, standard_main
try: # if you don't have amplpy installed, the code will still load and then fail on solve
from amplpy import AMPL
except:
AMPL = None
input_schema = PanDatFactory (
commodities=[["Name"], ["Vol... | # Simplest multi-commodity flow example using amplpy and ticdat
from ticdat import PanDatFactory, standard_main
try: # if you don't have amplpy installed, the code will still load and then fail on solve
from amplpy import AMPL
except:
AMPL = None
input_schema = PanDatFactory (
commodities=[["Name"], ["Vol... | en | 0.748584 | # Simplest multi-commodity flow example using amplpy and ticdat # if you don't have amplpy installed, the code will still load and then fail on solve set NODES; set ARCS within {i in NODES, j in NODES: i <> j}; set COMMODITIES; param volume {COMMODITIES} > 0, < Infinity; param capacity {ARCS} >= 0; ... | 2.764125 | 3 |
eval_retrieval_video.py | MikeWangWZHL/BLIP | 473 | 6627003 | <reponame>MikeWangWZHL/BLIP
'''
* Copyright (c) 2022, salesforce.com, inc.
* All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
* By <NAME>
'''
import argparse
import os
import ruamel_yaml as ya... | '''
* Copyright (c) 2022, salesforce.com, inc.
* All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
* By <NAME>
'''
import argparse
import os
import ruamel_yaml as yaml
import numpy as np
import... | en | 0.515081 | * Copyright (c) 2022, salesforce.com, inc. * All rights reserved. * SPDX-License-Identifier: BSD-3-Clause * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause * By <NAME> # test #Video->Text # Compute metrics #Text->Video # Compute metrics # fix the seed for... | 1.950219 | 2 |
pype/hosts/maya/plugins/publish/validate_no_default_camera.py | simonebarbieri/pype | 0 | 6627004 | from maya import cmds
import pyblish.api
import pype.api
import pype.hosts.maya.api.action
class ValidateNoDefaultCameras(pyblish.api.InstancePlugin):
"""Ensure no default (startup) cameras are in the instance.
This might be unnecessary. In the past there were some issues with
referencing/importing file... | from maya import cmds
import pyblish.api
import pype.api
import pype.hosts.maya.api.action
class ValidateNoDefaultCameras(pyblish.api.InstancePlugin):
"""Ensure no default (startup) cameras are in the instance.
This might be unnecessary. In the past there were some issues with
referencing/importing file... | en | 0.951596 | Ensure no default (startup) cameras are in the instance. This might be unnecessary. In the past there were some issues with referencing/importing files that contained the start up cameras overriding settings when being loaded and sometimes being skipped. Process all the cameras in the instance | 2.49577 | 2 |
frontmatter/default_handlers.py | notslang/python-frontmatter | 0 | 6627005 | <reponame>notslang/python-frontmatter
# -*- coding: utf-8 -*-
"""
.. testsetup:: handlers
import frontmatter
By default, ``frontmatter`` reads and writes YAML metadata. But maybe
you don't like YAML. Maybe enjoy writing metadata in JSON, or TOML, or
some other exotic markup not yet invented. For this, there are h... | # -*- coding: utf-8 -*-
"""
.. testsetup:: handlers
import frontmatter
By default, ``frontmatter`` reads and writes YAML metadata. But maybe
you don't like YAML. Maybe enjoy writing metadata in JSON, or TOML, or
some other exotic markup not yet invented. For this, there are handlers.
This module includes handler... | en | 0.629243 | # -*- coding: utf-8 -*- .. testsetup:: handlers import frontmatter By default, ``frontmatter`` reads and writes YAML metadata. But maybe you don't like YAML. Maybe enjoy writing metadata in JSON, or TOML, or some other exotic markup not yet invented. For this, there are handlers. This module includes handlers fo... | 2.718309 | 3 |
hyperbo/gp_utils/slice_sampling_test.py | google-research/hyperbo | 3 | 6627006 | <filename>hyperbo/gp_utils/slice_sampling_test.py
# coding=utf-8
# Copyright 2022 HyperBO Authors.
#
# 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/LICEN... | <filename>hyperbo/gp_utils/slice_sampling_test.py
# coding=utf-8
# Copyright 2022 HyperBO Authors.
#
# 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/LICEN... | en | 0.737064 | # coding=utf-8 # Copyright 2022 HyperBO Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag... | 2.053267 | 2 |
population_estimator/geography.py | cruzanta/population-estimator | 1 | 6627007 | <reponame>cruzanta/population-estimator<gh_stars>1-10
#!/usr/bin/env python
class Geography:
"""Class for storing a geography's population data.
Attributes:
name: A string containing the name of a geography.
annual_pop_ests: A list of population estimates represented as integers.
firs... | #!/usr/bin/env python
class Geography:
"""Class for storing a geography's population data.
Attributes:
name: A string containing the name of a geography.
annual_pop_ests: A list of population estimates represented as integers.
first_pop_est: An integer that represents a geography's fi... | en | 0.833116 | #!/usr/bin/env python Class for storing a geography's population data. Attributes: name: A string containing the name of a geography. annual_pop_ests: A list of population estimates represented as integers. first_pop_est: An integer that represents a geography's first population ... | 4.134895 | 4 |
LeetcodeAlgorithms/091. Decode Ways/decode-ways.py | Fenghuapiao/PyLeetcode | 3 | 6627008 | <gh_stars>1-10
class Solution(object):
def numDecodings(self, s):
"""
:type s: str
:rtype: int
"""
if len(s) == 0:
return 0
dp = [0] * (len(s) + 1)
dp[0] = 1
dp[1] = 0 if s[0] == "0" else 1
for i in xrange(1, len(s)):
... | class Solution(object):
def numDecodings(self, s):
"""
:type s: str
:rtype: int
"""
if len(s) == 0:
return 0
dp = [0] * (len(s) + 1)
dp[0] = 1
dp[1] = 0 if s[0] == "0" else 1
for i in xrange(1, len(s)):
pre =... | en | 0.328618 | :type s: str
:rtype: int | 2.723337 | 3 |
mosfit/modules/arrays/kernel.py | klukosiute/MOSFiT | 0 | 6627009 | """Definitions for the `Kernel` class."""
from collections import OrderedDict
import numpy as np
from six import string_types
from mosfit.constants import ANG_CGS, C_CGS
from mosfit.modules.arrays.array import Array
# Important: Only define one ``Module`` class per file.
class Kernel(Array):
"""Calculate the ... | """Definitions for the `Kernel` class."""
from collections import OrderedDict
import numpy as np
from six import string_types
from mosfit.constants import ANG_CGS, C_CGS
from mosfit.modules.arrays.array import Array
# Important: Only define one ``Module`` class per file.
class Kernel(Array):
"""Calculate the ... | en | 0.771652 | Definitions for the `Kernel` class. # Important: Only define one ``Module`` class per file. Calculate the kernel for use in computing the likelihood score. Initialize module. Process module. # If we are trying to krig between observations, we need an array with # dimensions equal to the number of intermediate observati... | 2.804156 | 3 |
deepchem/feat/material_featurizers/element_property_fingerprint.py | SanjeevaRDodlapati/deepchem | 3 | 6627010 | import numpy as np
from deepchem.utils.typing import PymatgenComposition
from deepchem.feat import MaterialCompositionFeaturizer
from typing import Any
class ElementPropertyFingerprint(MaterialCompositionFeaturizer):
"""
Fingerprint of elemental properties from composition.
Based on the data source chosen, re... | import numpy as np
from deepchem.utils.typing import PymatgenComposition
from deepchem.feat import MaterialCompositionFeaturizer
from typing import Any
class ElementPropertyFingerprint(MaterialCompositionFeaturizer):
"""
Fingerprint of elemental properties from composition.
Based on the data source chosen, re... | en | 0.569786 | Fingerprint of elemental properties from composition. Based on the data source chosen, returns properties and statistics (min, max, range, mean, standard deviation, mode) for a compound based on elemental stoichiometry. E.g., the average electronegativity of atoms in a crystal structure. The chemical fingerpri... | 2.393363 | 2 |
sumologic_collectd_metrics/metrics_config.py | joy-highfidelity/sumologic-collectd-plugin | 0 | 6627011 | <filename>sumologic_collectd_metrics/metrics_config.py
# -*- coding: utf-8 -*-
from . metrics_util import validate_non_empty, validate_string_type, validate_positive, \
validate_non_negative, validate_field
class ConfigOptions(object):
"""
Config options
"""
types_db = 'TypesDB'
url = 'URL'
... | <filename>sumologic_collectd_metrics/metrics_config.py
# -*- coding: utf-8 -*-
from . metrics_util import validate_non_empty, validate_string_type, validate_positive, \
validate_non_negative, validate_field
class ConfigOptions(object):
"""
Config options
"""
types_db = 'TypesDB'
url = 'URL'
... | en | 0.30402 | # -*- coding: utf-8 -*- Config options # Http header options # Metrics Batching options # Http post request frequency option # Http retry options # Memory option # Content encoding option # Static option, not configurable yet. Default is application/vnd.sumologic.carbon2 # seconds Configuration for sumologic collectd p... | 1.805408 | 2 |
src/python/pants/backend/jvm/tasks/coursier/coursier_subsystem.py | viktortnk/pants | 1 | 6627012 | <reponame>viktortnk/pants
# Copyright 2017 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import os
from typing import List
import requests
from pants.base.build_environment import get_pants_cachedir
from pants.core.util_rules.external_tool import Ex... | # Copyright 2017 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import os
from typing import List
import requests
from pants.base.build_environment import get_pants_cachedir
from pants.core.util_rules.external_tool import ExternalTool, ExternalToolEr... | en | 0.738118 | # Copyright 2017 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). Common configuration items for coursier tasks. :API: public Indicates an error bootstrapping coursier. # Quiet mode, so coursier does not show resolve progress, # but still prints resu... | 2.063622 | 2 |
mssdk/pro/cons.py | baierxxl/mssdk | 0 | 6627013 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
Date: 2020/12/24 16:28
Desc: API常量文件
"""
TOKEN_F_P = '<PASSWORD>'
TOKEN_ERR_MSG = '请设置 mssdk pro 的 token 凭证码,如果没有权限,请访问 https://qhkch.com/ 注册申请'
| #!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
Date: 2020/12/24 16:28
Desc: API常量文件
"""
TOKEN_F_P = '<PASSWORD>'
TOKEN_ERR_MSG = '请设置 mssdk pro 的 token 凭证码,如果没有权限,请访问 https://qhkch.com/ 注册申请'
| en | 0.296957 | #!/usr/bin/env python # -*- coding:utf-8 -*- Date: 2020/12/24 16:28 Desc: API常量文件 | 1.276979 | 1 |
Intermediate/19/Project/turtleRace.py | Matthew1906/100DaysOfPython | 1 | 6627014 | <reponame>Matthew1906/100DaysOfPython<gh_stars>1-10
# Import modules
from turtle import Turtle, Screen
from random import randint
colors = ['red','purple','yellow','green','blue', 'black']
def init_turtle(index, y):
turtle = Turtle()
turtle.shape("turtle")
turtle.color(colors[index])
turtle.penup()
... | # Import modules
from turtle import Turtle, Screen
from random import randint
colors = ['red','purple','yellow','green','blue', 'black']
def init_turtle(index, y):
turtle = Turtle()
turtle.shape("turtle")
turtle.color(colors[index])
turtle.penup()
turtle.goto(x=-230,y=y)
return turtle
canvas ... | fa | 0.067518 | # Import modules | 4.182977 | 4 |
online_test/settings.py | patilnayan92/etonlinetest | 2 | 6627015 | <filename>online_test/settings.py
"""
Django settings for online_test project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
from nayan.pipeline.settings import A... | <filename>online_test/settings.py
"""
Django settings for online_test project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
from nayan.pipeline.settings import A... | en | 0.655548 | Django settings for online_test project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) # The d... | 1.891263 | 2 |
klab/bio/protein_sequence.py | Kortemme-Lab/klab | 2 | 6627016 | <gh_stars>1-10
#!/usr/bin/env python2
# encoding: utf-8
# The MIT License (MIT)
#
# 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... | #!/usr/bin/env python2
# encoding: utf-8
# The MIT License (MIT)
#
# 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... | en | 0.759424 | #!/usr/bin/env python2 # encoding: utf-8 # The MIT License (MIT) # # 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,... | 1.364174 | 1 |
examples/python/alldifferent_except_0.py | prezaei85/or-tools | 3 | 6627017 | <reponame>prezaei85/or-tools<filename>examples/python/alldifferent_except_0.py
# Copyright 2010 <NAME> <EMAIL>
#
# 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/li... | # Copyright 2010 <NAME> <EMAIL>
#
# 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 writin... | en | 0.685446 | # Copyright 2010 <NAME> <EMAIL> # # 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 writin... | 1.938441 | 2 |
driving_school/motio.py | psorus/anogen | 0 | 6627018 | <reponame>psorus/anogen
from learnfrom import *
import numpy as np
from tqdm import tqdm
dphi=0.01
dr=0.01
def findbestnext(x0,y0,xm1,ym1,p):
phi=np.arange(np.random.random()*dphi,2*np.pi,dphi)
x=[x0+dr*np.sin(p) for p in phi]
y=[y0+dr*np.cos(p) for p in phi]
val=[lossbyparam(xx,yy,*p) for xx,yy in zip(x,y)]
... | from learnfrom import *
import numpy as np
from tqdm import tqdm
dphi=0.01
dr=0.01
def findbestnext(x0,y0,xm1,ym1,p):
phi=np.arange(np.random.random()*dphi,2*np.pi,dphi)
x=[x0+dr*np.sin(p) for p in phi]
y=[y0+dr*np.cos(p) for p in phi]
val=[lossbyparam(xx,yy,*p) for xx,yy in zip(x,y)]
q=[]
# q=val
drsq=... | en | 0.210606 | # q=val #move in the same direction # zw-=dra*0.1 # print("minidex",i,len(x),len(y),len(q),len(phi)) | 2.686715 | 3 |
databricks/koalas/tests/test_dataframe.py | akarsh3007/koalas | 1 | 6627019 | <reponame>akarsh3007/koalas
#
# Copyright (C) 2019 Databricks, 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 a... | #
# Copyright (C) 2019 Databricks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | en | 0.446369 | # # Copyright (C) 2019 Databricks, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i... | 2.544967 | 3 |
pytorch_lightning/core/root_module.py | ammaraskar/pytorch-lightning | 0 | 6627020 | <reponame>ammaraskar/pytorch-lightning
"""
.. warning:: `root_module` module has been renamed to `lightning` since v0.6.0.
The deprecated module name will be removed in v0.8.0.
"""
import warnings
warnings.warn("`root_module` module has been renamed to `lightning` since v0.6.0."
" The deprecated module... | """
.. warning:: `root_module` module has been renamed to `lightning` since v0.6.0.
The deprecated module name will be removed in v0.8.0.
"""
import warnings
warnings.warn("`root_module` module has been renamed to `lightning` since v0.6.0."
" The deprecated module name will be removed in v0.8.0.", Depr... | en | 0.731688 | .. warning:: `root_module` module has been renamed to `lightning` since v0.6.0. The deprecated module name will be removed in v0.8.0. | 1.259982 | 1 |
looking_for_group/games/migrations/0014_auto_20181017_1629.py | andrlik/looking-for-group | 0 | 6627021 | # Generated by Django 2.1.2 on 2018-10-17 20:29
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('games', '0013_auto_20181017_1307'),
]
operations = [
migrations.AlterModelOptions(
name='gameposting',
options={'ord... | # Generated by Django 2.1.2 on 2018-10-17 20:29
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('games', '0013_auto_20181017_1307'),
]
operations = [
migrations.AlterModelOptions(
name='gameposting',
options={'ord... | en | 0.758008 | # Generated by Django 2.1.2 on 2018-10-17 20:29 | 1.883553 | 2 |
tests/test_teamSeasonRange.py | jaebradley/nba_data | 8 | 6627022 | from unittest import TestCase
from nba_data.data.season import Season
from nba_data.data.season_range import SeasonRange
from nba_data.data.team import Team
from nba_data.data.team_season_range import TeamSeasonRange
class TestTeamSeasonRange(TestCase):
def test_instantiation(self):
team = Team.atlanta_h... | from unittest import TestCase
from nba_data.data.season import Season
from nba_data.data.season_range import SeasonRange
from nba_data.data.team import Team
from nba_data.data.team_season_range import TeamSeasonRange
class TestTeamSeasonRange(TestCase):
def test_instantiation(self):
team = Team.atlanta_h... | none | 1 | 3.065618 | 3 | |
hatbot.py | mikro6/hatbot | 6 | 6627023 | # hatbot - a very basic Owncast chat bot
# Public Domain, written 2021 by hatniX
# https://github.com/hatniX/hatbot
#
# Requirements:
# Owncast - https://owncast.online
# Python3 - https://www.python.org/
# Flask - https://flask.palletsprojects.com/
#
# Setup Owncast webhook url: http://localhost:5000/webho... | # hatbot - a very basic Owncast chat bot
# Public Domain, written 2021 by hatniX
# https://github.com/hatniX/hatbot
#
# Requirements:
# Owncast - https://owncast.online
# Python3 - https://www.python.org/
# Flask - https://flask.palletsprojects.com/
#
# Setup Owncast webhook url: http://localhost:5000/webho... | en | 0.612625 | # hatbot - a very basic Owncast chat bot # Public Domain, written 2021 by hatniX # https://github.com/hatniX/hatbot # # Requirements: # Owncast - https://owncast.online # Python3 - https://www.python.org/ # Flask - https://flask.palletsprojects.com/ # # Setup Owncast webhook url: http://localhost:5000/webho... | 2.356518 | 2 |
migration/versions/016_UserArtwork_columns_need_not_be_nullable.py | eevee/floof | 2 | 6627024 | from sqlalchemy import *
import sqlalchemy.exc
from migrate import *
from sqlalchemy.ext.declarative import declarative_base
TableBase = declarative_base()
from migrate.changeset import schema # monkeypatches columns
# Stubs for old tables
class User(TableBase):
__tablename__ = 'users'
id = Column(Integer,... | from sqlalchemy import *
import sqlalchemy.exc
from migrate import *
from sqlalchemy.ext.declarative import declarative_base
TableBase = declarative_base()
from migrate.changeset import schema # monkeypatches columns
# Stubs for old tables
class User(TableBase):
__tablename__ = 'users'
id = Column(Integer,... | en | 0.851335 | # monkeypatches columns # Stubs for old tables # Old tables # Primary keys can't actually be NULLable in pg, so this will raise | 2.13107 | 2 |
main.py | rcourivaud/query_categorizer | 0 | 6627025 | <reponame>rcourivaud/query_categorizer
from query_categorizer.query_categorizer import QueryCategorizer
qc = QueryCategorizer()
print(qc.predict_query("rone"))
| from query_categorizer.query_categorizer import QueryCategorizer
qc = QueryCategorizer()
print(qc.predict_query("rone")) | none | 1 | 1.813373 | 2 | |
scrabbler.py | novakeith/scrabbler | 0 | 6627026 | <reponame>novakeith/scrabbler<filename>scrabbler.py
# coding: UTF-8
# Scrabbler by KNOVA -- v1.3
# submitted as part of the reddit.com/r/dailyprogrammer challenge #294
# see here: https://www.reddit.com/r/dailyprogrammer/comments/5go843/20161205_challenge_294_easy_rack_management_1/
import timeit
# scrabble letter val... | # coding: UTF-8
# Scrabbler by KNOVA -- v1.3
# submitted as part of the reddit.com/r/dailyprogrammer challenge #294
# see here: https://www.reddit.com/r/dailyprogrammer/comments/5go843/20161205_challenge_294_easy_rack_management_1/
import timeit
# scrabble letter values
ltrVal = {'?':0, 'a':1, 'b':3, 'c':3, 'd':2, 'e'... | en | 0.831696 | # coding: UTF-8 # Scrabbler by KNOVA -- v1.3 # submitted as part of the reddit.com/r/dailyprogrammer challenge #294 # see here: https://www.reddit.com/r/dailyprogrammer/comments/5go843/20161205_challenge_294_easy_rack_management_1/ # scrabble letter values # returns a dictionary of the letters in a given word and the f... | 3.591404 | 4 |
centimani/__init__.py | NoZip/centimani | 1 | 6627027 | __all__ = ("log")
__version__ = "0.4"
| __all__ = ("log")
__version__ = "0.4"
| none | 1 | 1.003848 | 1 | |
1stRound/Hard/42-Trapping Rain Water/TwoPointers.py | ericchen12377/Leetcode-Algorithm-Python | 2 | 6627028 | <gh_stars>1-10
class Solution(object):
def trap(self, height):
"""
:type height: List[int]
:rtype: int
"""
Total = 0
left, right = 0, len(height) - 1
maxL = 0
maxR = 0
while left < right:
if height[left] <= height[right]:
... | class Solution(object):
def trap(self, height):
"""
:type height: List[int]
:rtype: int
"""
Total = 0
left, right = 0, len(height) - 1
maxL = 0
maxR = 0
while left < right:
if height[left] <= height[right]:
... | en | 0.365502 | :type height: List[int] :rtype: int | 3.323012 | 3 |
students/K33401/Fomenko_Ivan/Lr1/task_1/server.py | aytakr/ITMO_ICT_WebDevelopment_2021-2022 | 7 | 6627029 | <filename>students/K33401/Fomenko_Ivan/Lr1/task_1/server.py
import socket
host = "localhost"
port = 14900
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.bind((host, port))
sock.listen(10)
clientsocket, address = sock.accept()
data = clientsocket.recv(16384)
udata = data.decode("utf-8")
print(udata)
cl... | <filename>students/K33401/Fomenko_Ivan/Lr1/task_1/server.py
import socket
host = "localhost"
port = 14900
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.bind((host, port))
sock.listen(10)
clientsocket, address = sock.accept()
data = clientsocket.recv(16384)
udata = data.decode("utf-8")
print(udata)
cl... | none | 1 | 2.939884 | 3 | |
python-icmperror/icmperror/icmperror/icmperror.py | igarny/pscheduler | 47 | 6627030 | <filename>python-icmperror/icmperror/icmperror/icmperror.py
"""
Functions for translating ICMP error codes to enumerated values.
"""
import json
import sys
icmp_errors = {
# Strings produced by traceroute, same as ICMP error code counterparts
'H': 'host-unreachable',
'N': 'net-unreachable',
'P': 'prot... | <filename>python-icmperror/icmperror/icmperror/icmperror.py
"""
Functions for translating ICMP error codes to enumerated values.
"""
import json
import sys
icmp_errors = {
# Strings produced by traceroute, same as ICMP error code counterparts
'H': 'host-unreachable',
'N': 'net-unreachable',
'P': 'prot... | en | 0.814656 | Functions for translating ICMP error codes to enumerated values. # Strings produced by traceroute, same as ICMP error code counterparts # ICMP Type 3 Error Codes, from RFC 792 # ICMP Type 3 Error Codes, from RFC 1122 # ICMP Type 3 Error Codes, from RFC 1122 Translate a code which is either a number or single letter, ... | 3.286378 | 3 |
terminalAI/gamelib/algocore.py | umerhasan17/mlds | 1 | 6627031 | import json
from .game_state import GameState
from .util import get_command, debug_write, BANNER_TEXT, send_command
class AlgoCore(object):
"""This class handles communication with the game itself. Your strategy should subclass it.
Attributes:
* config (JSON): json object containing information about... | import json
from .game_state import GameState
from .util import get_command, debug_write, BANNER_TEXT, send_command
class AlgoCore(object):
"""This class handles communication with the game itself. Your strategy should subclass it.
Attributes:
* config (JSON): json object containing information about... | en | 0.872103 | This class handles communication with the game itself. Your strategy should subclass it. Attributes: * config (JSON): json object containing information about the game Override this to perform initial setup at the start of the game, based on the config, a json file which contains information about ... | 3.405058 | 3 |
API/waypi/routes/__init__.py | OdegaOmie/WayApp | 0 | 6627032 | __all__ = ["users", "test_routes"] | __all__ = ["users", "test_routes"] | none | 1 | 1.042558 | 1 | |
archives/oldtwitch2youtubeold.py | Hagnor/twitch2youtube | 0 | 6627033 | import os
def parseOK(path):
tab_init=[]
tab_all=[]
nline=0
nblien=0
block=0
with open (path, 'rt') as infile:
for line in infile:
nline=nline+1
if 'lien' in line:
if block!=0:
print("Input file error, lien")
... | import os
def parseOK(path):
tab_init=[]
tab_all=[]
nline=0
nblien=0
block=0
with open (path, 'rt') as infile:
for line in infile:
nline=nline+1
if 'lien' in line:
if block!=0:
print("Input file error, lien")
... | ru | 0.180727 | #print(firstparse) #print(list_fic) #print(pos_nom) | 2.820347 | 3 |
1030.py | TheLurkingCat/TIOJ | 0 | 6627034 | <filename>1030.py
n = int(input())
while n:
k = sorted([int(x) for x in input().split()])
floor = 1 + sum(k)
floor += k[-1]
print(floor)
n = int(input())
| <filename>1030.py
n = int(input())
while n:
k = sorted([int(x) for x in input().split()])
floor = 1 + sum(k)
floor += k[-1]
print(floor)
n = int(input())
| none | 1 | 3.099143 | 3 | |
wukong/tools/python/djadump.py | BigstarPie/WuKongProject | 0 | 6627035 | <filename>wukong/tools/python/djadump.py
# <property name="djarchive_type_lib_infusion" value="0"/>
# <property name="djarchive_type_app_infusion" value="1"/>
# <property name="djarchive_type_wkpf_link_table" value="2"/>
# <property name="djarchive_type_wkpf_component_map" value="3"/>
# <property na... | <filename>wukong/tools/python/djadump.py
# <property name="djarchive_type_lib_infusion" value="0"/>
# <property name="djarchive_type_app_infusion" value="1"/>
# <property name="djarchive_type_wkpf_link_table" value="2"/>
# <property name="djarchive_type_wkpf_component_map" value="3"/>
# <property na... | en | 0.139171 | # <property name="djarchive_type_lib_infusion" value="0"/> # <property name="djarchive_type_app_infusion" value="1"/> # <property name="djarchive_type_wkpf_link_table" value="2"/> # <property name="djarchive_type_wkpf_component_map" value="3"/> # <property name="djarchive_type_wkpf_initvalues" value="4"/> # file should... | 2.432236 | 2 |
kernel_hmc/tools/file.py | karlnapf/kernel_hmc | 27 | 6627036 | import hashlib
from kernel_hmc.tools.log import logger
def sha1sum(fname, blocksize=65536):
"""
Computes sha1sum of the given file. Same as the unix command line hash.
Returns: string with the hex-formatted sha1sum hash
"""
hasher = hashlib.sha1()
with open(fname, 'rb') as afile:
l... | import hashlib
from kernel_hmc.tools.log import logger
def sha1sum(fname, blocksize=65536):
"""
Computes sha1sum of the given file. Same as the unix command line hash.
Returns: string with the hex-formatted sha1sum hash
"""
hasher = hashlib.sha1()
with open(fname, 'rb') as afile:
l... | en | 0.781766 | Computes sha1sum of the given file. Same as the unix command line hash. Returns: string with the hex-formatted sha1sum hash | 3.237165 | 3 |
backend/work/migrations/0007_workitem_worktag.py | ecto0310/groupware | 3 | 6627037 | <reponame>ecto0310/groupware
# Generated by Django 3.0.3 on 2021-09-21 09:11
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('tool', '0007_auto_20200521_0031'),
migrations.swappabl... | # Generated by Django 3.0.3 on 2021-09-21 09:11
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('tool', '0007_auto_20200521_0031'),
migrations.swappable_dependency(settings.AUTH_US... | en | 0.796275 | # Generated by Django 3.0.3 on 2021-09-21 09:11 | 1.714786 | 2 |
seisflows/system/parallel.py | umairbinwaheed/seisflows | 2 | 6627038 |
import os
from os.path import abspath, join
from subprocess import Popen
from time import sleep
import numpy as np
from seisflows.tools import unix
from seisflows.tools.code import saveobj
from seisflows.tools.config import SeisflowsParameters, SeisflowsPaths, \
ParameterError, findpath, loadclass
PAR = Seisfl... |
import os
from os.path import abspath, join
from subprocess import Popen
from time import sleep
import numpy as np
from seisflows.tools import unix
from seisflows.tools.code import saveobj
from seisflows.tools.config import SeisflowsParameters, SeisflowsPaths, \
ParameterError, findpath, loadclass
PAR = Seisfl... | en | 0.788776 | An interface through which to submit workflows, run tasks in serial or parallel, and perform other system functions. By hiding environment details behind a python interface layer, these classes provide a consistent command set across different computing environments. For more informati... | 2.36676 | 2 |
src/utility/constant.py | William9923/IF4072-SentimentClassification | 0 | 6627039 | <filename>src/utility/constant.py
# --- [Constant running process] ---
SEED = 123
CONFIG_CLS = "config"
OPTION_CLS = "option"
# --- [Preprocessor Component] ---
LOWERCASE_COMPONENT = "lower"
MASK_URL_COMPONENT = "mask.url"
REMOVE_HTML_TAG_COMPONENT = "remove.html.tag"
MASK_EMOJI_COMPONENT = "mask.emoji"
REMOVE_PUNCT_C... | <filename>src/utility/constant.py
# --- [Constant running process] ---
SEED = 123
CONFIG_CLS = "config"
OPTION_CLS = "option"
# --- [Preprocessor Component] ---
LOWERCASE_COMPONENT = "lower"
MASK_URL_COMPONENT = "mask.url"
REMOVE_HTML_TAG_COMPONENT = "remove.html.tag"
MASK_EMOJI_COMPONENT = "mask.emoji"
REMOVE_PUNCT_C... | en | 0.897017 | # --- [Constant running process] --- # --- [Preprocessor Component] --- # --- [Classification Related] --- # --- [Experiment Option Related] --- | 1.658358 | 2 |
backend/alembic/versions/20200930112537_cf4962b43209_add_pipeline_table.py | BodenmillerGroup/histocat-web | 4 | 6627040 | <filename>backend/alembic/versions/20200930112537_cf4962b43209_add_pipeline_table.py<gh_stars>1-10
"""Add pipeline table
Revision ID: cf4962b43209
Revises: <PASSWORD>
Create Date: 2020-09-30 11:25:37.650804
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects.postgresql import JSONB
# revisio... | <filename>backend/alembic/versions/20200930112537_cf4962b43209_add_pipeline_table.py<gh_stars>1-10
"""Add pipeline table
Revision ID: cf4962b43209
Revises: <PASSWORD>
Create Date: 2020-09-30 11:25:37.650804
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects.postgresql import JSONB
# revisio... | en | 0.457857 | Add pipeline table Revision ID: cf4962b43209 Revises: <PASSWORD> Create Date: 2020-09-30 11:25:37.650804 # revision identifiers, used by Alembic. | 1.52097 | 2 |
last_numeral.py | nikitadragaa/--- | 1 | 6627041 | <filename>last_numeral.py
a=str(input())
print(a[-1])
| <filename>last_numeral.py
a=str(input())
print(a[-1])
| none | 1 | 2.787212 | 3 | |
pypy/module/binascii/interp_hexlify.py | nanjekyejoannah/pypy | 381 | 6627042 | from pypy.interpreter.error import OperationError, oefmt
from pypy.interpreter.gateway import unwrap_spec
from rpython.rlib.rstring import StringBuilder
from rpython.rlib.rarithmetic import ovfcheck
# ____________________________________________________________
def _value2char(value):
if value < 10:
retur... | from pypy.interpreter.error import OperationError, oefmt
from pypy.interpreter.gateway import unwrap_spec
from rpython.rlib.rstring import StringBuilder
from rpython.rlib.rarithmetic import ovfcheck
# ____________________________________________________________
def _value2char(value):
if value < 10:
retur... | en | 0.73251 | # ____________________________________________________________ Hexadecimal representation of binary data. This function is also available as "hexlify()". # ____________________________________________________________ Binary data of hexadecimal representation. hexstr must contain an even number of hex digits (upper or l... | 2.286622 | 2 |
src/pyig/commandline/execution_deprec.py | jwillis0720/PyIg | 0 | 6627043 | #!/usr/bin/env python
import subprocess as sp
import multiprocessing as mp
import glob
import os
import gzip
import datetime
from shutil import copytree
#Non Standard Library
from pyig.backend import split_fasta
from pyig.backend import output_parser
from pyig.commandline import arg_parse
def run_mp_and_delete(manage... | #!/usr/bin/env python
import subprocess as sp
import multiprocessing as mp
import glob
import os
import gzip
import datetime
from shutil import copytree
#Non Standard Library
from pyig.backend import split_fasta
from pyig.backend import output_parser
from pyig.commandline import arg_parse
def run_mp_and_delete(manage... | en | 0.693238 | #!/usr/bin/env python #Non Standard Library main method to run igblast through multiprocessing protocol, takes in a list of dictionaires each with a seperate set of arguments # bools # file name outputs, these will all be temp files to be parsed later # temporary path # check on internal data # set up the command l... | 2.444128 | 2 |
app.py | ChristianJohn0/swift-post-api | 0 | 6627044 | import flask
import easypost
app = flask.Flask(__name__)
easypost.api_key = "<KEY>"
@app.route("/", methods=['GET'])
def home():
return '''<h1>Swift Post API</h1>
<hr>
<p>This is the Application Programming Interface for the iOS application (SwiftPost) which is an application for tracking packages from mu... | import flask
import easypost
app = flask.Flask(__name__)
easypost.api_key = "<KEY>"
@app.route("/", methods=['GET'])
def home():
return '''<h1>Swift Post API</h1>
<hr>
<p>This is the Application Programming Interface for the iOS application (SwiftPost) which is an application for tracking packages from mu... | en | 0.863776 | <h1>Swift Post API</h1> <hr> <p>This is the Application Programming Interface for the iOS application (SwiftPost) which is an application for tracking packages from multiple delivery services such as Canada Post, FedEX, UPS, Purolator, DHL, etc.</p> <p>This API makes use of the <a href="https://www.easypost... | 2.819191 | 3 |
preprocess/preprocess_pipeline.py | weishengtoh/machinelearning_assignment | 0 | 6627045 | <reponame>weishengtoh/machinelearning_assignment
'''
Define the pipeline component that is used to clean the raw data used for training
and evaluation.
This pipeline component uses the raw data artifact generated by the dataloader_pipeline
component. The raw data artifact student-mat.csv is retrieved from Weights & Bi... | '''
Define the pipeline component that is used to clean the raw data used for training
and evaluation.
This pipeline component uses the raw data artifact generated by the dataloader_pipeline
component. The raw data artifact student-mat.csv is retrieved from Weights & Biases.
This pipeline component generates the clea... | en | 0.813138 | Define the pipeline component that is used to clean the raw data used for training and evaluation. This pipeline component uses the raw data artifact generated by the dataloader_pipeline component. The raw data artifact student-mat.csv is retrieved from Weights & Biases. This pipeline component generates the cleaned ... | 2.709266 | 3 |
moya/tags/soup.py | moyaproject/moya | 129 | 6627046 | from __future__ import unicode_literals
from __future__ import print_function
from ..elements.elementbase import Attribute
from ..tags.context import DataSetter
from ..compat import text_type
from ..html import slugify
from .. import namespaces
from lxml.cssselect import CSSSelector
from lxml.html import tostring, fr... | from __future__ import unicode_literals
from __future__ import print_function
from ..elements.elementbase import Attribute
from ..tags.context import DataSetter
from ..compat import text_type
from ..html import slugify
from .. import namespaces
from lxml.cssselect import CSSSelector
from lxml.html import tostring, fr... | en | 0.586274 | Represents an HTML tag. Manipulate HTML with CSS selectors. The [c]select[/c] attribute should be a CSS selector which will filter tags from the [c]src[/c] string. The other attributes define what should happen to the matches tags. The following example defines a [tag]filter[/tag] which uses [tag]{soup}strain... | 3.013416 | 3 |
tests/integration/test_charm.py | canonical/mysql-router-k8s-operator | 0 | 6627047 | #!/usr/bin/env python3
# Copyright 2022 Canonical Ltd.
# See LICENSE file for licensing details.
import logging
import socket
from pathlib import Path
import pytest
import yaml
from pytest_operator.plugin import OpsTest
logger = logging.getLogger(__name__)
METADATA = yaml.safe_load(Path("./metadata.yaml").read_tex... | #!/usr/bin/env python3
# Copyright 2022 Canonical Ltd.
# See LICENSE file for licensing details.
import logging
import socket
from pathlib import Path
import pytest
import yaml
from pytest_operator.plugin import OpsTest
logger = logging.getLogger(__name__)
METADATA = yaml.safe_load(Path("./metadata.yaml").read_tex... | en | 0.772321 | #!/usr/bin/env python3 # Copyright 2022 Canonical Ltd. # See LICENSE file for licensing details. Build the charm-under-test and deploy it together with related charms. Assert on the unit status before any relations/configurations take place. # build and deploy charm from local source folder Test if the application... | 1.867218 | 2 |
features/steps/login.py | nmfzone/django-modern-boilerplate | 2 | 6627048 | from behave import *
import crayons
@given('a web browser is on the Login page')
@when('a web browser is on the Login page')
def step_impl(context):
path = '/login'.lstrip('/')
context.browser.visit(context.base_url + '/' + path)
def console(text, bold=False):
print(crayons.yellow(text, bold=bold))
| from behave import *
import crayons
@given('a web browser is on the Login page')
@when('a web browser is on the Login page')
def step_impl(context):
path = '/login'.lstrip('/')
context.browser.visit(context.base_url + '/' + path)
def console(text, bold=False):
print(crayons.yellow(text, bold=bold))
| none | 1 | 2.401097 | 2 | |
regtests/c++/stack_mode.py | secureosv/pythia | 17 | 6627049 | <gh_stars>10-100
'''
stack memory mode
'''
with stack:
let garr : [10]int
grange = range(3)
class Bar:
def __init__(self, value:string):
self.value = value
class Foo:
def __init__(self, ok:bool):
self.ok = ok
let self.arr1: [4]Bar
class Sub(Foo):
def __init__(self, arr2:[4]Bar):
#self.arr2[...... | '''
stack memory mode
'''
with stack:
let garr : [10]int
grange = range(3)
class Bar:
def __init__(self, value:string):
self.value = value
class Foo:
def __init__(self, ok:bool):
self.ok = ok
let self.arr1: [4]Bar
class Sub(Foo):
def __init__(self, arr2:[4]Bar):
#self.arr2[...] = arr2 ## sho... | en | 0.828064 | stack memory mode #self.arr2[...] = arr2 ## should work but fails #self.arr2[...] = addr(arr2[0]) ## should also but work fails ## workaround, copy data ## in stack mode classes `act-like None` | 3.058431 | 3 |
extractOptimizedCoords.py | roverman/gaussian_log_file_converter | 6 | 6627050 | import sys
import re
if len(sys.argv) < 3 :
print "Usage: pyton extractOptimizedCoords.py input.log xyz|gjf"
print "The output file name will be input[_optimized]_out.xyz|gjf"
print "If optimization failed, the coordinates for the lowest energy structure will be used."
exit()
finput = sys.argv[1]
fformat = sys.ar... | import sys
import re
if len(sys.argv) < 3 :
print "Usage: pyton extractOptimizedCoords.py input.log xyz|gjf"
print "The output file name will be input[_optimized]_out.xyz|gjf"
print "If optimization failed, the coordinates for the lowest energy structure will be used."
exit()
finput = sys.argv[1]
fformat = sys.ar... | en | 0.302187 | # print format specific headers # \n\nComplex " + prefix + "\n\n") | 2.821995 | 3 |