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 |
|---|---|---|---|---|---|---|---|---|---|---|
scripts/update_dreqs/update_dreqs_0263.py | jonseddon/primavera-dmt | 0 | 6624551 | #!/usr/bin/env python
"""
update_dreqs_0263.py
Create a retrieval request for data that's required for ESGF publication for
EC-Earth Stream 1 highres-future.
"""
from __future__ import unicode_literals, division, absolute_import
import argparse
import datetime
import logging.config
import sys
import django
django.s... | #!/usr/bin/env python
"""
update_dreqs_0263.py
Create a retrieval request for data that's required for ESGF publication for
EC-Earth Stream 1 highres-future.
"""
from __future__ import unicode_literals, division, absolute_import
import argparse
import datetime
import logging.config
import sys
import django
django.s... | en | 0.256195 | #!/usr/bin/env python update_dreqs_0263.py Create a retrieval request for data that's required for ESGF publication for EC-Earth Stream 1 highres-future. Parse command-line arguments Main entry point # data_reqs = DataRequest.objects.filter( # climate_model__short_name='EC-Earth3P', # experiment__short_name='... | 2.530815 | 3 |
phonenumber_field/modelfields.py | mediapredict/django-phonenumber-field | 0 | 6624552 | <reponame>mediapredict/django-phonenumber-field<filename>phonenumber_field/modelfields.py<gh_stars>0
# -*- coding: utf-8 -*-
from builtins import object
from django.core import validators
from django.db import models
from django.utils.translation import ugettext_lazy as _
from phonenumber_field.validators import valid... | # -*- coding: utf-8 -*-
from builtins import object
from django.core import validators
from django.db import models
from django.utils.translation import ugettext_lazy as _
from phonenumber_field.validators import validate_international_phonenumber
from phonenumber_field import formfields
from phonenumber_field.phonenu... | en | 0.646003 | # -*- coding: utf-8 -*- The descriptor for the phone number attribute on the model instance. Returns a PhoneNumber when accessed so you can do stuff like:: >>> instance.phone_number.as_international Assigns a phone number object on assignment so you can do:: >>> instance.phone_number = PhoneN... | 2.417709 | 2 |
sdk/python/pulumi_azure_native/authorization/v20160901/outputs.py | pulumi-bot/pulumi-azure-native | 31 | 6624553 | <gh_stars>10-100
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilit... | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | en | 0.948637 | # coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** Lock owner properties. Lock owner properties. :param str application_id: The application ID of the lock owner. The application ID of the lock ow... | 1.714069 | 2 |
tests/diffex/diffexSrc/src/ccalnoir/ccalnoir/machine_learning/glmnet.py | genepattern/docker-aws-python36 | 0 | 6624554 | import numbers
import numpy as np
import pandas as pd
import rpy2.robjects as ro
from rpy2.robjects import numpy2ri
from rpy2.robjects.packages import importr
from sklearn.base import BaseEstimator, ClassifierMixin, RegressorMixin
from sklearn.utils import compute_class_weight
glmnet = importr("glmnet")
base = import... | import numbers
import numpy as np
import pandas as pd
import rpy2.robjects as ro
from rpy2.robjects import numpy2ri
from rpy2.robjects.packages import importr
from sklearn.base import BaseEstimator, ClassifierMixin, RegressorMixin
from sklearn.utils import compute_class_weight
glmnet = importr("glmnet")
base = import... | en | 0.895667 | class GLMNet(BaseEstimator, RegressorMixin): # Todo: flesh out this class for non-CV fitting def __init__(self, alpha=0, l1_ratio=0.5): self.coef_ = None self.alpha = alpha self.l1_ratio = l1_ratio def fit(self, x, y, upper=None, lower=None): pass def predict(self, x):... | 2.434759 | 2 |
server/ema/views.py | eIGato/mahjong-portal | 10 | 6624555 | import datetime
from django.shortcuts import render
from rating.models import Rating, RatingResult
from rating.utils import get_latest_rating_date
def best_countries(request):
rating = Rating.objects.get(type=Rating.EMA)
today, rating_date = get_latest_rating_date(rating)
ema_ratings = RatingResult.obje... | import datetime
from django.shortcuts import render
from rating.models import Rating, RatingResult
from rating.utils import get_latest_rating_date
def best_countries(request):
rating = Rating.objects.get(type=Rating.EMA)
today, rating_date = get_latest_rating_date(rating)
ema_ratings = RatingResult.obje... | en | 0.888914 | More details: http://mahjong-europe.org/ranking/BasicsQuotas.html # European and World champions # First, seats will be given to all countries in descending order of ranking # After this, seats will be given to all countries with a player with >700 points, in # descending order of country ranking (part A3) # Then s... | 2.331207 | 2 |
Exemplos/gerador_aleatorio.py | RCSM/workshop-cawen-2019 | 0 | 6624556 | import random
nums = []
for _ in range(21):
nums.append(random.randint(0, 999))
print(nums) | import random
nums = []
for _ in range(21):
nums.append(random.randint(0, 999))
print(nums) | none | 1 | 3.151911 | 3 | |
tencent/callback_url.py | wangjinyu124419/long_audio_asr | 0 | 6624557 | import time
import logging
import logging.handlers
import json
import tornado.ioloop
import tornado.web
import tornado.httpserver
from tornado.options import define,options
define("port", default=8322, type=int, help="run server on the given port.") # 定义服务器监听端口选项
def setup_logging(level=logging.DEBUG, stream=True, ... | import time
import logging
import logging.handlers
import json
import tornado.ioloop
import tornado.web
import tornado.httpserver
from tornado.options import define,options
define("port", default=8322, type=int, help="run server on the given port.") # 定义服务器监听端口选项
def setup_logging(level=logging.DEBUG, stream=True, ... | zh | 0.650421 | # 定义服务器监听端口选项 #定义tornado的post方法 # logger.debug('get_result_fail %r',err) | 2.451422 | 2 |
render.py | ziotom78/pytracer | 2 | 6624558 | # -*- encoding: utf-8 -*-
#
# The MIT License (MIT)
#
# Copyright © 2021 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
# documentation files (the “Software”), to deal in the Software without restriction, including without limitation the
# rights ... | # -*- encoding: utf-8 -*-
#
# The MIT License (MIT)
#
# Copyright © 2021 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
# documentation files (the “Software”), to deal in the Software without restriction, including without limitation the
# rights ... | en | 0.824302 | # -*- encoding: utf-8 -*- # # The MIT License (MIT) # # Copyright © 2021 <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated # documentation files (the “Software”), to deal in the Software without restriction, including without limitation the # rights ... | 2.025115 | 2 |
tests/parsers/plist_plugins/appleaccount.py | bodik/plaso | 0 | 6624559 | <reponame>bodik/plaso<filename>tests/parsers/plist_plugins/appleaccount.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Tests for the Apple account plist plugin."""
from __future__ import unicode_literals
import unittest
from plaso.formatters import plist # pylint: disable=unused-import
from plaso.parsers.plis... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Tests for the Apple account plist plugin."""
from __future__ import unicode_literals
import unittest
from plaso.formatters import plist # pylint: disable=unused-import
from plaso.parsers.plist_plugins import appleaccount
from tests.parsers.plist_plugins import test... | en | 0.725567 | #!/usr/bin/env python3 # -*- coding: utf-8 -*- Tests for the Apple account plist plugin. # pylint: disable=unused-import Tests for the Apple account plist plugin. Tests the Process function. # The order in which PlistParser generates events is nondeterministic # hence we sort the events. | 2.291354 | 2 |
martools/marttools.py | sourcery-ai-bot/predacogs | 0 | 6624560 | import asyncio
import time
import logging
from collections import Counter
from datetime import datetime
from typing import Union
import apsw
import discord
import lavalink
from redbot.cogs.audio.audio_dataclasses import Query
from redbot.core import Config, bank, commands
from redbot.core.bot import Red
from redbot.co... | import asyncio
import time
import logging
from collections import Counter
from datetime import datetime
from typing import Union
import apsw
import discord
import lavalink
from redbot.cogs.audio.audio_dataclasses import Query
from redbot.core import Config, bank, commands
from redbot.core.bot import Red
from redbot.co... | en | 0.904051 | Multiple tools that are originally used on Martine. Nothing to delete. Thanks Sinbad! Show stats of the bank. Show the usage count of the bot. Commands processed, messages received, and music on servers. Permanent stats since first time that the cog has been loaded. Show all prefixes of the bot Send servers sta... | 1.987974 | 2 |
Google-Playstore-/code.py | anajikadam17/ga-learner-dsmp-repo | 0 | 6624561 | <reponame>anajikadam17/ga-learner-dsmp-repo<filename>Google-Playstore-/code.py<gh_stars>0
# --------------
#Importing header files
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
#Code starts here
data = pd.read_csv(path)
data = data[data['Rating']<=5]
sns.countplot('Rating', data=data)
#Co... | # --------------
#Importing header files
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
#Code starts here
data = pd.read_csv(path)
data = data[data['Rating']<=5]
sns.countplot('Rating', data=data)
#Code ends here
# --------------
# code starts here
total_null = data.isnull().sum()
perce... | en | 0.525354 | # -------------- #Importing header files #Code starts here #Code ends here # -------------- # code starts here # code ends here # -------------- #Code starts here #Code ends here # -------------- #Importing header files #Code starts here # data['Installs'] = data['Installs'].str.extract('(\d+)', expand=False).astype(in... | 2.972195 | 3 |
setup.py | marickmanrho/ToCM_reference_data | 0 | 6624562 | # Setup for the ToCM reference data package
#
# Written using https://packaging.python.org/tutorials/packaging-projects/
# Most importandly import setuptools
from setuptools import setup
import os
# Use README.md as long description
with open("README.md", "r") as file:
long_description = file.read()
# Use requir... | # Setup for the ToCM reference data package
#
# Written using https://packaging.python.org/tutorials/packaging-projects/
# Most importandly import setuptools
from setuptools import setup
import os
# Use README.md as long description
with open("README.md", "r") as file:
long_description = file.read()
# Use requir... | en | 0.714187 | # Setup for the ToCM reference data package # # Written using https://packaging.python.org/tutorials/packaging-projects/ # Most importandly import setuptools # Use README.md as long description # Use requirements.txt as requirements | 1.988986 | 2 |
label_studio/utils/argparser.py | gauthamsuresh09/label-studio | 0 | 6624563 | import os
from label_studio.utils.io import find_dir
from label_studio.utils.misc import iter_config_templates
def parse_input_args():
""" Combine args with json config
:return: config dict
"""
import sys
import argparse
if len(sys.argv) == 1:
print('\nQuick start usage: label-studi... | import os
from label_studio.utils.io import find_dir
from label_studio.utils.misc import iter_config_templates
def parse_input_args():
""" Combine args with json config
:return: config dict
"""
import sys
import argparse
if len(sys.argv) == 1:
print('\nQuick start usage: label-studi... | en | 0.362423 | Combine args with json config :return: config dict # init sub-command parser # start sub-command parser # start-multi-session sub-command parser | 2.107168 | 2 |
tridentstream/metadata/tag/handler.py | tridentstream/mediaserver | 6 | 6624564 | import logging
from rest_framework import serializers
from ...bases.metadata.linkingmetadata import LinkingMetadataHandlerPlugin
from .filters import MetadataFilter
from .models import ListingItemRelation, Tag
logger = logging.getLogger(__name__)
class TagSerializer(serializers.ModelSerializer):
id = serialize... | import logging
from rest_framework import serializers
from ...bases.metadata.linkingmetadata import LinkingMetadataHandlerPlugin
from .filters import MetadataFilter
from .models import ListingItemRelation, Tag
logger = logging.getLogger(__name__)
class TagSerializer(serializers.ModelSerializer):
id = serialize... | none | 1 | 2.115383 | 2 | |
wb_load_model.py | Tiago-Minuzzi/phd-proj | 0 | 6624565 | import os
import sys
import numpy as np
import pandas as pd
import tensorflow as tf
from Bio import SeqIO
from numpy import array
from numpy import argmax
from warnings import simplefilter
from contextlib import redirect_stderr
from sklearn.preprocessing import LabelEncoder
from sklearn.preprocessing import OneHotEncod... | import os
import sys
import numpy as np
import pandas as pd
import tensorflow as tf
from Bio import SeqIO
from numpy import array
from numpy import argmax
from warnings import simplefilter
from contextlib import redirect_stderr
from sklearn.preprocessing import LabelEncoder
from sklearn.preprocessing import OneHotEncod... | en | 0.705455 | # Hide warning messages # Show full array and dataframe (without truncation) # Show full data frame (without truncation) # Show full arrays (without truncation) # I/O files # Check whether the element exists #tes_mdl = "models/model_var01.05.wb.hdf5" # Pre-processing functions # Fasta to data frame # Sequence onehot en... | 2.229855 | 2 |
tests/async/test_dialog.py | tumregels/playwright-python | 2 | 6624566 | # Copyright (c) Microsoft Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | # Copyright (c) Microsoft Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | en | 0.488724 | # Copyright (c) Microsoft Corporation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri... | 2.177548 | 2 |
Bite 1. Sum n numbers.py | Guznin/PyBites | 1 | 6624567 | """
Write a function that can sum up numbers:
It should receive a list of n numbers.
If no argument is provided, return sum of numbers 1..100.
Look closely to the type of the function's default argument ..
"""
def sum_numbers(numbers=None):
if numbers == None:
return sum(range(101))
else:
retur... | """
Write a function that can sum up numbers:
It should receive a list of n numbers.
If no argument is provided, return sum of numbers 1..100.
Look closely to the type of the function's default argument ..
"""
def sum_numbers(numbers=None):
if numbers == None:
return sum(range(101))
else:
retur... | en | 0.719425 | Write a function that can sum up numbers: It should receive a list of n numbers. If no argument is provided, return sum of numbers 1..100. Look closely to the type of the function's default argument .. | 4.212989 | 4 |
123 Best Time to Buy and Sell Stock III.py | scorpionpd/LeetCode-all | 0 | 6624568 | <reponame>scorpionpd/LeetCode-all
"""
Say you have an array for which the ith element is the price of a given stock on day i.
Design an algorithm to find the maximum profit. You may complete at most two transactions.
Note:
You may not engage in multiple transactions at the same time (ie, you must sell the stock befor... | """
Say you have an array for which the ith element is the price of a given stock on day i.
Design an algorithm to find the maximum profit. You may complete at most two transactions.
Note:
You may not engage in multiple transactions at the same time (ie, you must sell the stock before you buy again).
"""
__author__ =... | en | 0.786767 | Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may complete at most two transactions. Note: You may not engage in multiple transactions at the same time (ie, you must sell the stock before you buy again). Algorithm: dp ... | 3.699475 | 4 |
decida-por-mim-main/main.py | RamonBomfim/decida-por-mim | 0 | 6624569 | <reponame>RamonBomfim/decida-por-mim
from time import sleep
import random
class DecidaPorMim():
def __init__(self):
self.respostas = [
'Não faço ideia.',
'Só sei que nada sei.',
'Tá maluco?',
'Com certeza... não.',
'É claro que sim.',
... | from time import sleep
import random
class DecidaPorMim():
def __init__(self):
self.respostas = [
'Não faço ideia.',
'Só sei que nada sei.',
'Tá maluco?',
'Com certeza... não.',
'É claro que sim.',
'Tá pegando fogo bicho!!!',
... | none | 1 | 3.963308 | 4 | |
main.py | ananyahjha93/challenges-in-disentangling | 12 | 6624570 | <reponame>ananyahjha93/challenges-in-disentangling
import argparse
from training import training_procedure
parser = argparse.ArgumentParser()
# add arguments
parser.add_argument('--cuda', type=bool, default=True, help="run the following code on a GPU")
parser.add_argument('--batch_size', type=int, default=64, help="... | import argparse
from training import training_procedure
parser = argparse.ArgumentParser()
# add arguments
parser.add_argument('--cuda', type=bool, default=True, help="run the following code on a GPU")
parser.add_argument('--batch_size', type=int, default=64, help="batch size for training")
parser.add_argument('--im... | en | 0.637208 | # add arguments # arguments to control per iteration training of architecture # loss function coefficient # paths to save models | 2.72939 | 3 |
authors/apps/articles/tests/test_bookmarks.py | andela/Ah-backend-valkyrie | 0 | 6624571 | from django.test import TestCase
from rest_framework.reverse import reverse
from rest_framework import status
from authors.apps.authentication.tests.base import BaseTestMethods
from authors.apps.articles.models import Article
from authors.apps.authentication.models import User
class BookmarkTestCase(BaseTestMethods)... | from django.test import TestCase
from rest_framework.reverse import reverse
from rest_framework import status
from authors.apps.authentication.tests.base import BaseTestMethods
from authors.apps.articles.models import Article
from authors.apps.authentication.models import User
class BookmarkTestCase(BaseTestMethods)... | en | 0.548345 | # bookmark article # create article # create article # bookmark article # unbookmark article # bookmark article # unbookmark article # bookmark article # unbookmark article # bookmark article # get article # bookmark article # get article | 2.328284 | 2 |
tests/test_realtime.py | xqdzn/pyzatt | 69 | 6624572 | <reponame>xqdzn/pyzatt<gh_stars>10-100
#!/usr/bin/env python
import pytest
import pyzatt.misc as misc
import pyzatt.pyzatt as pyzatt
import pyzatt.zkmodules.defs as DEFS
"""
Test script to test/show parsing functions of the realtime spec/lib.
WARNING: Apply this test to devices that aren't under current use,
if ... | #!/usr/bin/env python
import pytest
import pyzatt.misc as misc
import pyzatt.pyzatt as pyzatt
import pyzatt.zkmodules.defs as DEFS
"""
Test script to test/show parsing functions of the realtime spec/lib.
WARNING: Apply this test to devices that aren't under current use,
if a deployed device is used, remember to ... | en | 0.839684 | #!/usr/bin/env python Test script to test/show parsing functions of the realtime spec/lib. WARNING: Apply this test to devices that aren't under current use, if a deployed device is used, remember to upload the data to the device(Sync) using the ZKAccess software, that will overwrite any changes made by th... | 2.272666 | 2 |
robot-server/tests/runs/test_run_data_manager.py | Opentrons/protocol_framework | 0 | 6624573 | <reponame>Opentrons/protocol_framework<filename>robot-server/tests/runs/test_run_data_manager.py
"""Tests for RunDataManager."""
from typing import Optional
import pytest
from datetime import datetime
from decoy import Decoy, matchers
from opentrons.types import DeckSlotName
from opentrons.protocol_runner import Prot... | """Tests for RunDataManager."""
from typing import Optional
import pytest
from datetime import datetime
from decoy import Decoy, matchers
from opentrons.types import DeckSlotName
from opentrons.protocol_runner import ProtocolRunResult
from opentrons.protocol_engine import (
EngineStatus,
StateSummary,
com... | en | 0.822096 | Tests for RunDataManager. Get a mock EngineStore. Get a mock RunStore. Get a mock background TaskRunner. Get a StateSummary value object. # type: ignore[call-arg] # type: ignore[call-arg] # type: ignore[call-arg] # type: ignore[call-arg] # type: ignore[call-arg] Get a StateSummary value object. Get a ProtocolEngine Com... | 2.286645 | 2 |
eos_potential.py | sotzee/quaryonic_eos | 1 | 6624574 | <filename>eos_potential.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Jun 2 15:11:14 2020
@author: sotzee
"""
import numpy as np
from sympy import symbols, diff,lambdify
import unitconvert
from config import saturation_density
class Fermions(object):
ns=saturation_density
def __init__... | <filename>eos_potential.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Jun 2 15:11:14 2020
@author: sotzee
"""
import numpy as np
from sympy import symbols, diff,lambdify
import unitconvert
from config import saturation_density
class Fermions(object):
ns=saturation_density
def __init__... | en | 0.469129 | #!/usr/bin/env python3 # -*- coding: utf-8 -*- Created on Tue Jun 2 15:11:14 2020 @author: sotzee #m in unit MeV, g is degenracy in spin or isospin... #x=kF/m demensionless #Not used in quarkyonic EOS | 2.588003 | 3 |
bank2ynab/bank_process.py | Kukkerem/bank2ynab | 0 | 6624575 | #!/usr/bin/env python3
#
# bank2ynab.py
#
# Searches specified folder or default download folder for exported
# bank transaction file (.csv format) & adjusts format for YNAB import
# Please see here for details: https://github.com/torbengb/bank2ynab
#
# MIT License: https://github.com/torbengb/bank2ynab/blob/master/LIC... | #!/usr/bin/env python3
#
# bank2ynab.py
#
# Searches specified folder or default download folder for exported
# bank transaction file (.csv format) & adjusts format for YNAB import
# Please see here for details: https://github.com/torbengb/bank2ynab
#
# MIT License: https://github.com/torbengb/bank2ynab/blob/master/LIC... | en | 0.735597 | #!/usr/bin/env python3 # # bank2ynab.py # # Searches specified folder or default download folder for exported # bank transaction file (.csv format) & adjusts format for YNAB import # Please see here for details: https://github.com/torbengb/bank2ynab # # MIT License: https://github.com/torbengb/bank2ynab/blob/master/LIC... | 2.726023 | 3 |
advance/fasle1-4.py | naeimnb/pythonexersices | 0 | 6624576 |
def is_capitalized(in_string):
part1, part2 = in_string[0], in_string[1:len(in_string)]
# print(part1, part2)
if part1.isupper() == True and part2.islower() == True:
return 1
else:
return 0
index_words = []
_in = []
_in = input().split(".")
cursor = 0
for sentence in _in:
word_l... |
def is_capitalized(in_string):
part1, part2 = in_string[0], in_string[1:len(in_string)]
# print(part1, part2)
if part1.isupper() == True and part2.islower() == True:
return 1
else:
return 0
index_words = []
_in = []
_in = input().split(".")
cursor = 0
for sentence in _in:
word_l... | en | 0.099692 | # print(part1, part2) | 3.966763 | 4 |
old_versions/travel.old.py | Pebecko/Reknamorcen | 0 | 6624577 | <filename>old_versions/travel.old.py
from fight import *
class RoomTypes:
def get_coordinates(self):
if player.last_direction is "North":
player.y -= 1
elif player.last_direction is "East":
player.x += 1
elif player.last_direction is "South":
player.y +=... | <filename>old_versions/travel.old.py
from fight import *
class RoomTypes:
def get_coordinates(self):
if player.last_direction is "North":
player.y -= 1
elif player.last_direction is "East":
player.x += 1
elif player.last_direction is "South":
player.y +=... | en | 0.360159 | # 1 # 2 # 3 # 1 # 2 # 3 # 2 # 1 # 3 # 3 # 2 # 1 # 1 # 2 # 3 # 1 # 2 # 3 # 2 # 1 # 3 # 3 # 2 # 1 # 1 # 2 # 3 # 1 # 2 # 3 # 2 # 1 # 3 # 3 # 2 # 1 # 1 # 2 # 3 # 1 # 2 # 3 # 2 # 1 # 3 # 3 # 2 # 1 # 1 # 2 # 2 # 1 # 3 # 1 # control part | 2.74231 | 3 |
lib/modes/mode_youtube.py | okonomichiyaki/parrot.py | 80 | 6624578 | <reponame>okonomichiyaki/parrot.py
from lib.detection_strategies import single_tap_detection, loud_detection, medium_detection, percentage_detection
import threading
import numpy as np
import pyautogui
from pyautogui import press, hotkey, click, scroll, typewrite, moveRel, moveTo, position
from time import sleep
from s... | from lib.detection_strategies import single_tap_detection, loud_detection, medium_detection, percentage_detection
import threading
import numpy as np
import pyautogui
from pyautogui import press, hotkey, click, scroll, typewrite, moveRel, moveTo, position
from time import sleep
from subprocess import call
from lib.syst... | none | 1 | 2.456192 | 2 | |
python/paddle/fluid/tests/unittests/test_sequence_expand.py | javakian/Paddle | 0 | 6624579 | <filename>python/paddle/fluid/tests/unittests/test_sequence_expand.py
# Copyright (c) 2018 PaddlePaddle 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
#
# ... | <filename>python/paddle/fluid/tests/unittests/test_sequence_expand.py
# Copyright (c) 2018 PaddlePaddle 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
#
# ... | en | 0.846132 | # Copyright (c) 2018 PaddlePaddle 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 app... | 2.401684 | 2 |
recip/util/Config.py | anthonybuckle/Reciprocity-Core | 0 | 6624580 | from recip.util import DataType
import json
import os
class Config:
with open('recip/config/config.json', 'r') as configFile:
config = json.load(configFile)
def setKeyValue(key, value):
Config.config[key] = value
def getIntValue(key, base=10):
return DataType.asInt(Config.config[key], base)
def ... | from recip.util import DataType
import json
import os
class Config:
with open('recip/config/config.json', 'r') as configFile:
config = json.load(configFile)
def setKeyValue(key, value):
Config.config[key] = value
def getIntValue(key, base=10):
return DataType.asInt(Config.config[key], base)
def ... | none | 1 | 2.670625 | 3 | |
tensorflow-client/python/mnist.py | fwz-fpga/inference-client | 20 | 6624581 | <gh_stars>10-100
#!/usr/bin/env python
import sys
import numpy as np
import tensorflow as tf
import requests
from tensorflow_serving.apis import predict_pb2
from google.protobuf.json_format import MessageToDict
def sendRequest(url):
request = predict_pb2.PredictRequest()
response = predict_pb2.PredictResponse(... | #!/usr/bin/env python
import sys
import numpy as np
import tensorflow as tf
import requests
from tensorflow_serving.apis import predict_pb2
from google.protobuf.json_format import MessageToDict
def sendRequest(url):
request = predict_pb2.PredictRequest()
response = predict_pb2.PredictResponse()
request.mo... | en | 0.192514 | #!/usr/bin/env python #!!! Add Appcode here # !!! set content type # !!! replace your token # print res.content # handle error msg | 2.570224 | 3 |
flexget/plugins/plugin_include.py | tvcsantos/Flexget | 0 | 6624582 | from __future__ import unicode_literals, division, absolute_import
import logging
import os
import yaml
from flexget import plugin
from flexget.config_schema import one_or_more, process_config
from flexget.event import event
from flexget.utils.tools import MergeException, merge_dict_from_to
log = logging.getLogger('i... | from __future__ import unicode_literals, division, absolute_import
import logging
import os
import yaml
from flexget import plugin
from flexget.config_schema import one_or_more, process_config
from flexget.event import event
from flexget.utils.tools import MergeException, merge_dict_from_to
log = logging.getLogger('i... | en | 0.75432 | Include configuration from another yaml file. Example:: include: series.yml File content must be valid for a task configuration # merge | 2.130388 | 2 |
hdfs/scripts/configure-hadoop.py | reynoldsm88/uzumaki | 0 | 6624583 | <reponame>reynoldsm88/uzumaki
import os
import argparse
hdfs_config_dir = os.environ[ "HADOOP_PREFIX" ] + "/etc/hadoop"
def write_core_site( hostname ):
core_site_template = read_file_as_string( "/tmp/core-site-template.xml" )
core_site_config = core_site_template.replace("${hostname}", hostname )
write_file( hdfs... | import os
import argparse
hdfs_config_dir = os.environ[ "HADOOP_PREFIX" ] + "/etc/hadoop"
def write_core_site( hostname ):
core_site_template = read_file_as_string( "/tmp/core-site-template.xml" )
core_site_config = core_site_template.replace("${hostname}", hostname )
write_file( hdfs_config_dir + "/core-site.xml"... | none | 1 | 2.615505 | 3 | |
smore/models/box.py | isabella232/smore | 78 | 6624584 | # 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 agreed to in writing,... | # 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 agreed to in writing,... | en | 0.818863 | # 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 agreed to in writing,... | 1.800499 | 2 |
SetShowAnswer.py | Colin-Fredericks/hx-util | 0 | 6624585 | <filename>SetShowAnswer.py<gh_stars>0
# import XML libraries
import xml.etree.ElementTree as ET
import sys
import os
import argparse
instructions = """
To use:
python3 SetShowAnswer.py show_answer_value path/to/problem/folder
show_answer_value can be one of the usual edX set:
Always
Answered
Attempted
Closed
... | <filename>SetShowAnswer.py<gh_stars>0
# import XML libraries
import xml.etree.ElementTree as ET
import sys
import os
import argparse
instructions = """
To use:
python3 SetShowAnswer.py show_answer_value path/to/problem/folder
show_answer_value can be one of the usual edX set:
Always
Answered
Attempted
Closed
... | en | 0.808292 | # import XML libraries To use: python3 SetShowAnswer.py show_answer_value path/to/problem/folder show_answer_value can be one of the usual edX set: Always Answered Attempted Closed Finished CorrectOrPastDue PastDue Never It can also be delete or default, in which case all show_answer values are remove... | 3.249408 | 3 |
py/trash/008-6_lgb0.py | KazukiOnodera/Microsoft-Malware-Prediction | 24 | 6624586 | <reponame>KazukiOnodera/Microsoft-Malware-Prediction
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Feb 20 09:29:01 2019
@author: Kazuki
"""
import numpy as np
import pandas as pd
import os, gc
from glob import glob
from tqdm import tqdm
import sys
sys.path.append(f'/home/{os.environ.get("USER")}/... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Feb 20 09:29:01 2019
@author: Kazuki
"""
import numpy as np
import pandas as pd
import os, gc
from glob import glob
from tqdm import tqdm
import sys
sys.path.append(f'/home/{os.environ.get("USER")}/PythonLibrary')
import lgbextension as ex
import ligh... | en | 0.394219 | #!/usr/bin/env python3 # -*- coding: utf-8 -*- Created on Wed Feb 20 09:29:01 2019 @author: Kazuki #============================================================================== # L2 regularization term on weights. # L1 regularization term on weights. # 'nthread': 32, # =======================================... | 1.751443 | 2 |
SAI/flexsai/p4/backend/output_stage/P4_api_SAI.py | bocon13/stratum-sonic | 0 | 6624587 | import os
from subprocess import call, Popen, PIPE
import re
import os
import sys
import json
from datetime import datetime
from shutil import copy2
from glob import glob
import P4_aux as aux
def api_set_lib_paths(lib, template_dir):
lib.h_template_path = os.path.join(template_dir, 'sai_lib_template.h')
lib.name ... | import os
from subprocess import call, Popen, PIPE
import re
import os
import sys
import json
from datetime import datetime
from shutil import copy2
from glob import glob
import P4_aux as aux
def api_set_lib_paths(lib, template_dir):
lib.h_template_path = os.path.join(template_dir, 'sai_lib_template.h')
lib.name ... | en | 0.231617 | #---------------------------------------------------------------------------- # header files gen #SAI_%s_ENTRY_ATTR_ACTION' % table.cname.upper()) # enum_txt+=' SAI_%s_ENTRY_ACTION_NO_ACTION,\n\n' % table.cname.upper() # enum_txt+=' /** upon table entry hit, invoke action %s */\n'%action_name # if action_name != ... | 2.098838 | 2 |
bikeshed/widlparser/widlparser/parser.py | dirkschulze/bikeshed | 0 | 6624588 | <filename>bikeshed/widlparser/widlparser/parser.py
# coding=utf-8
#
# Copyright © 2013 Hewlett-Packard Development Company, L.P.
#
# This work is distributed under the W3C® Software License [1]
# in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of
# MERCH... | <filename>bikeshed/widlparser/widlparser/parser.py
# coding=utf-8
#
# Copyright © 2013 Hewlett-Packard Development Company, L.P.
#
# This work is distributed under the W3C® Software License [1]
# in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of
# MERCH... | en | 0.717169 | # coding=utf-8 # # Copyright © 2013 Hewlett-Packard Development Company, L.P. # # This work is distributed under the W3C® Software License [1] # in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # # [1] http:... | 2.408528 | 2 |
lab3/main.py | iamNCJ/CV-2020 | 0 | 6624589 | <gh_stars>0
import cv2
import matplotlib.pyplot as plt
import numpy as np
from tqdm import tqdm
cam = cv2.VideoCapture(0)
while True:
# Capture frame-by-frame
_, img = cam.read()
# img = cv2.imread('assets/sample.jpg')
# Color to grayscale
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
gray = np... | import cv2
import matplotlib.pyplot as plt
import numpy as np
from tqdm import tqdm
cam = cv2.VideoCapture(0)
while True:
# Capture frame-by-frame
_, img = cam.read()
# img = cv2.imread('assets/sample.jpg')
# Color to grayscale
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
gray = np.float32(gra... | en | 0.710342 | # Capture frame-by-frame # img = cv2.imread('assets/sample.jpg') # Color to grayscale # Spatial derivative calculation # Structure tensor setup # Harris response calculation # dst = cv2.cornerHarris(gray, 2, 3, 0.04) # result is dilated for marking the corners, not important # Threshold for an optimal value, it may var... | 2.760818 | 3 |
.travis/manage_daily_builds.py | loonwerks/jkind-plugin | 0 | 6624590 | <filename>.travis/manage_daily_builds.py
#!/usr/bin/env python3
'''
Created on May 16, 2019
'''
import os
import re
from github3 import GitHub
from pprint import pformat
GITHUB_API = 'https://api.github.com/repos'
GITHUB_RELEASES = 'releases'
AUTH_TOKEN = os.environ['GH_TOKEN'] if 'GH_TOKEN' in os.environ.keys() e... | <filename>.travis/manage_daily_builds.py
#!/usr/bin/env python3
'''
Created on May 16, 2019
'''
import os
import re
from github3 import GitHub
from pprint import pformat
GITHUB_API = 'https://api.github.com/repos'
GITHUB_RELEASES = 'releases'
AUTH_TOKEN = os.environ['GH_TOKEN'] if 'GH_TOKEN' in os.environ.keys() e... | en | 0.85349 | #!/usr/bin/env python3 Created on May 16, 2019 # obtain git handle # get list of releases # extract keys and sort by build date # filter to obtain the keys to delete # iterate, deleting the releases and corresponding tags # Look for stale files in the release # print(' asset named %s matches %s' % (asset.name, match.g... | 2.466351 | 2 |
src/apply_manual_codes.py | AfricasVoices/Project-ADSS | 0 | 6624591 | <reponame>AfricasVoices/Project-ADSS<gh_stars>0
import time
from os import path
from core_data_modules.cleaners import Codes
from core_data_modules.cleaners.cleaning_utils import CleaningUtils
from core_data_modules.cleaners.location_tools import SomaliaLocations
from core_data_modules.traced_data import Metadata
from... | import time
from os import path
from core_data_modules.cleaners import Codes
from core_data_modules.cleaners.cleaning_utils import CleaningUtils
from core_data_modules.cleaners.location_tools import SomaliaLocations
from core_data_modules.traced_data import Metadata
from core_data_modules.traced_data.io import TracedD... | en | 0.940262 | # Up to 1 location code should have been assigned in Coda. Search for that code, # ensuring that only 1 has been assigned or, if multiple have been assigned, that they are non-conflicting # control codes # If no code was found, then this location is still not reviewed. # Synthesise a NOT_REVIEWED code accordingly. # If... | 1.989488 | 2 |
package/spack-bison/package.py | ctuning/ck-spack | 1 | 6624592 | <reponame>ctuning/ck-spack<filename>package/spack-bison/package.py
##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by <... | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by <NAME>, <EMAIL>, All rights reserved.
# LLNL-CODE-647188
#
# For det... | en | 0.759017 | ############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by <NAME>, <EMAIL>, All rights reserved. # LLNL-CODE-647188 # # For det... | 1.819244 | 2 |
tests/examples/minlplib/pooling_foulds3tp.py | ouyang-w-19/decogo | 2 | 6624593 | <reponame>ouyang-w-19/decogo
# NLP written by GAMS Convert at 04/21/18 13:53:10
#
# Equation counts
# Total E G L N X C B
# 572 521 0 51 0 0 0 0
#
# Variable counts
# x b i ... | # NLP written by GAMS Convert at 04/21/18 13:53:10
#
# Equation counts
# Total E G L N X C B
# 572 521 0 51 0 0 0 0
#
# Variable counts
# x b i s1s s2s sc ... | en | 0.736804 | # NLP written by GAMS Convert at 04/21/18 13:53:10 # # Equation counts # Total E G L N X C B # 572 521 0 51 0 0 0 0 # # Variable counts # x b i s1s s2s sc s... | 1.73176 | 2 |
agents/fitness/mode_nil.py | gvrooyen/SocialLearning | 1 | 6624594 | <filename>agents/fitness/mode_nil.py
# Automatically rendered agent code
from moves import *
import math
import random
last_state = None
last_state_matrix = None
def move(roundsAlive, repertoire, historyRounds, historyMoves, historyActs, historyPayoffs, historyDemes, currentDeme,
canChooseModel, canPlayRefi... | <filename>agents/fitness/mode_nil.py
# Automatically rendered agent code
from moves import *
import math
import random
last_state = None
last_state_matrix = None
def move(roundsAlive, repertoire, historyRounds, historyMoves, historyActs, historyPayoffs, historyDemes, currentDeme,
canChooseModel, canPlayRefi... | en | 0.912012 | # Automatically rendered agent code # Exit condition 1: The agent is a pioneer, and N_rounds rounds have elapsed # Exit condition 2: We've tested, and the agent is not a pioneer # Otherwise, remain in the current state # We haven't made a move yet, give us a chance first! # No move yet #print ("Entered at round %d, cha... | 2.667905 | 3 |
src/pretix/base/i18n.py | awg24/pretix | 1 | 6624595 | <reponame>awg24/pretix
import copy
import json
from django import forms
from django.conf import settings
from django.db.models import SubfieldBase, TextField
from django.utils import translation
from django.utils.safestring import mark_safe
class LazyI18nString:
"""
This represents an internationalized strin... | import copy
import json
from django import forms
from django.conf import settings
from django.db.models import SubfieldBase, TextField
from django.utils import translation
from django.utils.safestring import mark_safe
class LazyI18nString:
"""
This represents an internationalized string that is/was/will be s... | en | 0.823527 | This represents an internationalized string that is/was/will be stored in the database. Input data should be a dictionary which maps language codes to content. Evaluate the given string with respect to the currently active locale. This will rather return you a string in a wrong language than give you an ... | 2.294893 | 2 |
ultideploy/commands/deploy.py | UltiManager/ultimanager-deployment | 0 | 6624596 | import os
import pathlib
import sys
from ultideploy import constants, credentials, resources
from ultideploy.steps import InstallIstio, LinkGithub, TerraformStep
PROJECT_ROOT = pathlib.Path(__file__).parents[2]
TERRAFORM_CLUSTER_CONFIG = PROJECT_ROOT / 'terraform' / 'cluster'
TERRAFORM_DATABASE_CONFIG = PROJECT_ROO... | import os
import pathlib
import sys
from ultideploy import constants, credentials, resources
from ultideploy.steps import InstallIstio, LinkGithub, TerraformStep
PROJECT_ROOT = pathlib.Path(__file__).parents[2]
TERRAFORM_CLUSTER_CONFIG = PROJECT_ROOT / 'terraform' / 'cluster'
TERRAFORM_DATABASE_CONFIG = PROJECT_ROO... | en | 0.399175 | Deploy the infrastructure. Args: args: The parsed CLI arguments. | 1.979586 | 2 |
dipper/sources/GeneReviews.py | sgml/dipper | 0 | 6624597 | <reponame>sgml/dipper<gh_stars>0
import re
import os
import csv
import logging
from bs4 import BeautifulSoup
from dipper.sources.OMIMSource import OMIMSource
from dipper.models.Model import Model
from dipper.models.Reference import Reference
__author__ = 'nicole'
LOG = logging.getLogger(__name__)
GRDL = 'http://ftp.... | import re
import os
import csv
import logging
from bs4 import BeautifulSoup
from dipper.sources.OMIMSource import OMIMSource
from dipper.models.Model import Model
from dipper.models.Reference import Reference
__author__ = 'nicole'
LOG = logging.getLogger(__name__)
GRDL = 'http://ftp.ncbi.nih.gov/pub/GeneReviews'
c... | en | 0.880747 | Here we process the GeneReviews mappings to OMIM, plus inspect the GeneReviews (html) books to pull the clinical descriptions in order to populate the definitions of the terms in the ontology. We define the GeneReviews items as classes that are either grouping classes over OMIM disease ids (gene ids are... | 2.277759 | 2 |
evaluator/lexer.py | rinald-shabani/evaluator | 3 | 6624598 | <reponame>rinald-shabani/evaluator<filename>evaluator/lexer.py
'''Defines a lexer for mathematical expressions.'''
from .token import Token
from .errors import ReadError
from .util import *
class Lexer:
'''Lexer for mathematical expressions.'''
EOI = '' # end of input
def __init__(self, expression):
... | '''Defines a lexer for mathematical expressions.'''
from .token import Token
from .errors import ReadError
from .util import *
class Lexer:
'''Lexer for mathematical expressions.'''
EOI = '' # end of input
def __init__(self, expression):
self.expression = expression
self.cursor_at = 0
... | en | 0.796551 | Defines a lexer for mathematical expressions. Lexer for mathematical expressions. # end of input # character under cursor Ignore whitespace characters. Move cursor forward. Peek next token. # reset cursor after read() Return next token. Read next token. # reached end of input # First we get generic types # Then we retu... | 3.729401 | 4 |
bioinformatics/ApproximatePatternCount.py | rhnvrm/mini-projects | 1 | 6624599 | <gh_stars>1-10
def ApproximatePatternCount(Pattern, Text, d):
count = 0 # initialize count variable
# your code here
for i in range(0,len(Text) - len(Pattern)+1):
if HammingDistance(Pattern, Text[i:i+len(Pattern)]) <= d:
count += 1
return count
| def ApproximatePatternCount(Pattern, Text, d):
count = 0 # initialize count variable
# your code here
for i in range(0,len(Text) - len(Pattern)+1):
if HammingDistance(Pattern, Text[i:i+len(Pattern)]) <= d:
count += 1
return count | en | 0.590136 | # initialize count variable # your code here | 3.388865 | 3 |
setup.py | quantamentals/portfolioVision | 0 | 6624600 | import setuptools
setuptools.setup(
name="portVision",
version="0.8",
description="Portfolio Analysis library for Cadence practice",
homepage="https://github.com/quantamentals/portfolioVision",
author="<NAME>",
author_email="<EMAIL>",
packages=['portVision','portVision.handler','portVision... | import setuptools
setuptools.setup(
name="portVision",
version="0.8",
description="Portfolio Analysis library for Cadence practice",
homepage="https://github.com/quantamentals/portfolioVision",
author="<NAME>",
author_email="<EMAIL>",
packages=['portVision','portVision.handler','portVision... | en | 0.673008 | # python3 -m pip install -e. # python setup.py sdist # twine upload dist/* | 1.38965 | 1 |
src/chaospizza/menus/tests.py | chaosdorf/chaospizza | 9 | 6624601 | <reponame>chaosdorf/chaospizza
# pylint: disable=C0111
from django.urls import reverse
def test_dummy_view(client): # noqa
response = client.get(reverse('menu_home'))
assert response.content == b'hi from menus app'
| # pylint: disable=C0111
from django.urls import reverse
def test_dummy_view(client): # noqa
response = client.get(reverse('menu_home'))
assert response.content == b'hi from menus app' | en | 0.411767 | # pylint: disable=C0111 # noqa | 1.936359 | 2 |
django_for_apis/project_1_library/books/models.py | rednafi/django-unchained | 1 | 6624602 | <filename>django_for_apis/project_1_library/books/models.py
from django.db import models
# Create your models here.
class Book(models.Model):
title = models.CharField(max_length=250)
subtitle = models.CharField(max_length=250)
author = models.CharField(max_length=100)
isbn = models.CharField(max_leng... | <filename>django_for_apis/project_1_library/books/models.py
from django.db import models
# Create your models here.
class Book(models.Model):
title = models.CharField(max_length=250)
subtitle = models.CharField(max_length=250)
author = models.CharField(max_length=100)
isbn = models.CharField(max_leng... | en | 0.963489 | # Create your models here. | 2.928867 | 3 |
recibrew/nn/transformers.py | haryoa/recibrew | 0 | 6624603 | <gh_stars>0
from torch.nn import Transformer, Embedding, Dropout, Module
import torch
import math
class PositionalEncoding(Module):
def __init__(self, d_model, dropout=0.1, max_len=100):
super(PositionalEncoding, self).__init__()
self.dropout = Dropout(p=dropout)
pe = torch.zeros(max_len,... | from torch.nn import Transformer, Embedding, Dropout, Module
import torch
import math
class PositionalEncoding(Module):
def __init__(self, d_model, dropout=0.1, max_len=100):
super(PositionalEncoding, self).__init__()
self.dropout = Dropout(p=dropout)
pe = torch.zeros(max_len, d_model)
... | en | 0.574942 | # [x : seq_len, batch_size ] # [ x : seq_len, batch_size, num_embedding ] Make mask attention that caused 'True' element will not be attended (ignored). Padding stated in self.padding_idx will not be attended at all. :param inp : input that to be masked in boolean Tensor forward! :param src :... | 2.461967 | 2 |
ci/ci/__init__.py | joonan30/hail | 0 | 6624604 | from .ci import run
__all__ = ['run']
| from .ci import run
__all__ = ['run']
| none | 1 | 0.944885 | 1 | |
api/test_main.py | pedromtelho/APS2-megadados | 0 | 6624605 | <reponame>pedromtelho/APS2-megadados<gh_stars>0
from fastapi.testclient import TestClient
from .main import app
import uuid
client = TestClient(app)
def test_read_main_returns_not_found():
response = client.get('/')
assert response.status_code == 404
assert response.json() == {'detail': 'Not Found'}
def... | from fastapi.testclient import TestClient
from .main import app
import uuid
client = TestClient(app)
def test_read_main_returns_not_found():
response = client.get('/')
assert response.status_code == 404
assert response.json() == {'detail': 'Not Found'}
def test_get_starter_tasks():
response = client... | en | 0.963041 | # check if the task has been inserted in the list # check if the task has been replaced in the list # check if the task has been deleted from the list # check if the task has been altered in the list | 2.645193 | 3 |
topi/tests/python/test_topi_pooling.py | wix-playground/incubator-tvm | 1 | 6624606 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | en | 0.863529 | # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u... | 2.165362 | 2 |
tensorflow/python/kernel_tests/pack_op_test.py | yxiong/tensorflow | 6 | 6624607 | <gh_stars>1-10
# Copyright 2015 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 requ... | # Copyright 2015 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.796732 | # Copyright 2015 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.193501 | 2 |
setup.py | mehsoy/jaws | 1 | 6624608 | #!/usr/bin/python
#-*- coding: utf-8 -*-
from setuptools import setup
setup(name='jaws',
version='0.1.0',
author=["<NAME>","<NAME>", "<NAME>", "<NAME>", "<NAME>", "<NAME>",
"<NAME>"],
author_email=["<EMAIL>", "<EMAIL>", "<EMAIL>", "<EMAIL>", "<EMAIL>", "<EMAIL>", "<EMAIL>"],
url="https://g... | #!/usr/bin/python
#-*- coding: utf-8 -*-
from setuptools import setup
setup(name='jaws',
version='0.1.0',
author=["<NAME>","<NAME>", "<NAME>", "<NAME>", "<NAME>", "<NAME>",
"<NAME>"],
author_email=["<EMAIL>", "<EMAIL>", "<EMAIL>", "<EMAIL>", "<EMAIL>", "<EMAIL>", "<EMAIL>"],
url="https://g... | en | 0.348434 | #!/usr/bin/python #-*- coding: utf-8 -*- | 1.193193 | 1 |
common/src/stack/command/stack/commands/report/host/bootfile/plugin_pxe.py | shivanshs9/stacki | 0 | 6624609 | # @copyright@
# Copyright (c) 2006 - 2018 Teradata
# All rights reserved. Stacki(r) v5.x stacki.com
# https://github.com/Teradata/stacki/blob/master/LICENSE.txt
# @copyright@
import os
import stack.commands
class Plugin(stack.commands.Plugin):
"""
Generate a PXE specific configuration file
"""
def provides(self... | # @copyright@
# Copyright (c) 2006 - 2018 Teradata
# All rights reserved. Stacki(r) v5.x stacki.com
# https://github.com/Teradata/stacki/blob/master/LICENSE.txt
# @copyright@
import os
import stack.commands
class Plugin(stack.commands.Plugin):
"""
Generate a PXE specific configuration file
"""
def provides(self... | en | 0.569862 | # @copyright@ # Copyright (c) 2006 - 2018 Teradata # All rights reserved. Stacki(r) v5.x stacki.com # https://github.com/Teradata/stacki/blob/master/LICENSE.txt # @copyright@ Generate a PXE specific configuration file # IP as Hex <stack:file stack:name="%s" stack:owner="root:apache" stack:perms="0664" stack... | 1.809764 | 2 |
treat/moc/cmm/__init__.py | tjlaboss/tasty_treat | 3 | 6624610 | <filename>treat/moc/cmm/__init__.py<gh_stars>1-10
from .cumulative import CumulativeMigrationCorrection
from .corrections import CORRECTIONS
| <filename>treat/moc/cmm/__init__.py<gh_stars>1-10
from .cumulative import CumulativeMigrationCorrection
from .corrections import CORRECTIONS
| none | 1 | 0.96515 | 1 | |
suricata-4.1.4/suricata-update/suricata/update/maps.py | runtest007/dpdk_surcata_4.1.1 | 77 | 6624611 | # Copyright (C) 2017 Open Information Security Foundation
# Copyright (c) 2013 <NAME>
#
# You can copy, redistribute or modify this Program under the terms of
# the GNU General Public License version 2 as published by the Free
# Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# ... | # Copyright (C) 2017 Open Information Security Foundation
# Copyright (c) 2013 <NAME>
#
# You can copy, redistribute or modify this Program under the terms of
# the GNU General Public License version 2 as published by the Free
# Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# ... | en | 0.655409 | # Copyright (C) 2017 Open Information Security Foundation # Copyright (c) 2013 <NAME> # # You can copy, redistribute or modify this Program under the terms of # the GNU General Public License version 2 as published by the Free # Software Foundation. # # This program is distributed in the hope that it will be useful, # ... | 2.111374 | 2 |
sunpy/tests/setup_command.py | ajeytiwary/sunpy | 1 | 6624612 | <reponame>ajeytiwary/sunpy
# -*- coding: utf-8 -*-
"""
Created on Sat Jun 7 19:36:08 2014
@author: <NAME>
This file is designed to be imported and ran only via setup.py, hence it's
dependancy on astropy_helpers which will be availible in that context.
"""
from astropy_helpers.test_helpers import AstropyTest
from as... | # -*- coding: utf-8 -*-
"""
Created on Sat Jun 7 19:36:08 2014
@author: <NAME>
This file is designed to be imported and ran only via setup.py, hence it's
dependancy on astropy_helpers which will be availible in that context.
"""
from astropy_helpers.test_helpers import AstropyTest
from astropy_helpers.compat import... | en | 0.860465 | # -*- coding: utf-8 -*- Created on Sat Jun 7 19:36:08 2014 @author: <NAME> This file is designed to be imported and ran only via setup.py, hence it's dependancy on astropy_helpers which will be availible in that context. # Package to test # Print all the things # plugins to enable # Run only offline tests? # Run onl... | 1.885016 | 2 |
src/cfnlint/rules/resources/DependsOn.py | amabowilli/cfn-python-lint | 1 | 6624613 | """
Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
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 ... | """
Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
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 ... | en | 0.74052 | Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. 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, c... | 2.042618 | 2 |
mlflow/entities/file_info.py | freefrag/mlflow | 1,825 | 6624614 | <filename>mlflow/entities/file_info.py
from mlflow.entities._mlflow_object import _MLflowObject
from mlflow.protos.service_pb2 import FileInfo as ProtoFileInfo
class FileInfo(_MLflowObject):
"""
Metadata about a file or directory.
"""
def __init__(self, path, is_dir, file_size):
self._path = p... | <filename>mlflow/entities/file_info.py
from mlflow.entities._mlflow_object import _MLflowObject
from mlflow.protos.service_pb2 import FileInfo as ProtoFileInfo
class FileInfo(_MLflowObject):
"""
Metadata about a file or directory.
"""
def __init__(self, path, is_dir, file_size):
self._path = p... | en | 0.836121 | Metadata about a file or directory. String path of the file or directory. Whether the FileInfo corresponds to a directory. Size of the file or directory. If the FileInfo is a directory, returns None. | 2.649911 | 3 |
CONFIG/StoryAPP/API/urls.py | Brktrlw/Instagram-Clone-Django-and-React | 0 | 6624615 | <filename>CONFIG/StoryAPP/API/urls.py
from django.urls import path
from .views import UserCurrentStoriesListAPIView,HomePageStoriesListAPIView,OwnStoriesListAPIView,StorySeeingCreateAPIView,UsersBySeeingStoryListAPIView
app_name="stories"
urlpatterns = [
path('username/<str:user__username>/',UserCurrentStoriesLis... | <filename>CONFIG/StoryAPP/API/urls.py
from django.urls import path
from .views import UserCurrentStoriesListAPIView,HomePageStoriesListAPIView,OwnStoriesListAPIView,StorySeeingCreateAPIView,UsersBySeeingStoryListAPIView
app_name="stories"
urlpatterns = [
path('username/<str:user__username>/',UserCurrentStoriesLis... | none | 1 | 2.156149 | 2 | |
mqtt-db/mqtt-postgres.py | rpoisel/AbbB23Energymeter | 0 | 6624616 | <gh_stars>0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from mqttlib import MeasurementBroker
import psycopg2
class PostgresWriter(object):
def __init__(self, connect_arg):
self.__conn = psycopg2.connect(connect_arg)
def on_measurement(self, solar, total):
cur = self.__conn.cursor()
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from mqttlib import MeasurementBroker
import psycopg2
class PostgresWriter(object):
def __init__(self, connect_arg):
self.__conn = psycopg2.connect(connect_arg)
def on_measurement(self, solar, total):
cur = self.__conn.cursor()
cur.execut... | en | 0.352855 | #!/usr/bin/env python # -*- coding: utf-8 -*- | 2.676782 | 3 |
blackswan/eodata.py | thaos/blackswan | 0 | 6624617 | <reponame>thaos/blackswan
from tempfile import mkstemp
from osgeo import gdal, osr
import cartopy.crs as ccrs
import matplotlib.pyplot as plt
from flyingpigeon import visualisation as vs
import logging
LOGGER = logging.getLogger("PYWPS")
def get_RGB(DIR, false_color=False):
"""
Extracts the files for RGB ba... | from tempfile import mkstemp
from osgeo import gdal, osr
import cartopy.crs as ccrs
import matplotlib.pyplot as plt
from flyingpigeon import visualisation as vs
import logging
LOGGER = logging.getLogger("PYWPS")
def get_RGB(DIR, false_color=False):
"""
Extracts the files for RGB bands of Sentinel2 directory... | en | 0.576395 | Extracts the files for RGB bands of Sentinel2 directory tree, scales and merge the values. Output is a merged tif including 3 bands. :param DIR: base directory of Sentinel2 directory tree :param false_color: if set to True the near infrared band (B08) will be taken as red band :returns geotif: merged ... | 2.674844 | 3 |
wiggin/actions/interactions.py | golobor/plugychrom | 0 | 6624618 | <gh_stars>0
from dataclasses import dataclass
import numbers
import numpy as np
from typing import Optional, Any, Union
import polychrom
from ..core import SimAction
from .. import forces
@dataclass
class Chains(SimAction):
chains: Any = ((0, None, False),)
bond_length: float = 1.0
wiggle_dist: float... | from dataclasses import dataclass
import numbers
import numpy as np
from typing import Optional, Any, Union
import polychrom
from ..core import SimAction
from .. import forces
@dataclass
class Chains(SimAction):
chains: Any = ((0, None, False),)
bond_length: float = 1.0
wiggle_dist: float = 0.25
... | en | 0.122589 | # do not use self.args! # only use parameters from self.ndonfig.shared | 2.649276 | 3 |
examples/LaTeX/4Derr.py | waldyrious/galgebra | 151 | 6624619 | <gh_stars>100-1000
from __future__ import print_function
from sympy import *
from galgebra.printer import Format,xpdf,xdvi
from galgebra.ga import Ga
def main():
Format()
snr=1
g = '0 0 1 0 ,0 0 0 1 ,1 0 0 0 ,0 1 0 0'
sk4coords = (e1,e2,e3,e4) = symbols('e1 e2 e3 e4')
sk4 = Ga('e_1 e_2 e_... | from __future__ import print_function
from sympy import *
from galgebra.printer import Format,xpdf,xdvi
from galgebra.ga import Ga
def main():
Format()
snr=1
g = '0 0 1 0 ,0 0 0 1 ,1 0 0 0 ,0 1 0 0'
sk4coords = (e1,e2,e3,e4) = symbols('e1 e2 e3 e4')
sk4 = Ga('e_1 e_2 e_3 e_4', g=g, coords... | none | 1 | 2.205395 | 2 | |
src/lambda/ppe-detector-function/test/graphql/test_mutation.py | gai6948/video-analytics-for-ppe-compliance | 0 | 6624620 | import os
import json
from main.graphql.mutation import make_mutation
def test_mutation_execution():
src_dirname = os.path.dirname(__file__)
src_filename = os.path.join(src_dirname, '../data/mutation-variables.json')
with open(src_filename, 'r') as fd:
variables = json.load(fd)
mutation = ""... | import os
import json
from main.graphql.mutation import make_mutation
def test_mutation_execution():
src_dirname = os.path.dirname(__file__)
src_filename = os.path.join(src_dirname, '../data/mutation-variables.json')
with open(src_filename, 'r') as fd:
variables = json.load(fd)
mutation = ""... | en | 0.367715 | mutation InjestFrame( $cameraId: String!, $ts: String!, $s3url: String, $ppeResult: PPEResultInput $ppeViolationCount: Int $pplCount: Int) { injestFrame( cameraId: $cameraId, ts: $ts, ... | 2.478608 | 2 |
weibo_comments_crawler.py | KeithYue/weibo-keywords-crawler | 16 | 6624621 | # coding=utf-8
class WeiboCommentsCrawler():
'''
A spider which is used to crawl all comments given a weibo item
'''
def __init__(self, client, weibo_mid):
'''
client: the weibo api client
weibo_mid: the specific weibo whose comments would be crawled
'''
self.cl... | # coding=utf-8
class WeiboCommentsCrawler():
'''
A spider which is used to crawl all comments given a weibo item
'''
def __init__(self, client, weibo_mid):
'''
client: the weibo api client
weibo_mid: the specific weibo whose comments would be crawled
'''
self.cl... | en | 0.807607 | # coding=utf-8 A spider which is used to crawl all comments given a weibo item client: the weibo api client weibo_mid: the specific weibo whose comments would be crawled # print(comments) # print(type(comments)) # print('comments number', len(results)) | 3.213267 | 3 |
src/tests/ftest/util/job_manager_utils.py | kmajzero/daos | 2 | 6624622 | #!/usr/bin/python
"""
(C) Copyright 2020-2021 Intel Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent
"""
# pylint: disable=too-many-lines
from datetime import datetime
from distutils.spawn import find_executable
import os
import re
import time
from ClusterShell.NodeSet import NodeSet
from command_utils ... | #!/usr/bin/python
"""
(C) Copyright 2020-2021 Intel Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent
"""
# pylint: disable=too-many-lines
from datetime import datetime
from distutils.spawn import find_executable
import os
import re
import time
from ClusterShell.NodeSet import NodeSet
from command_utils ... | en | 0.763111 | #!/usr/bin/python (C) Copyright 2020-2021 Intel Corporation. SPDX-License-Identifier: BSD-2-Clause-Patent # pylint: disable=too-many-lines A class for commands with parameters that manage other commands. Create a JobManager object. Args: namespace (str): yaml namespace (path to parameters) ... | 2.306018 | 2 |
lale/schemas.py | ariffyasri/lale | 1 | 6624623 | # Copyright 2019 IBM Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | # Copyright 2019 IBM Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | en | 0.8428 | # Copyright 2019 IBM Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ... | 2.252419 | 2 |
tests/test_reproducibility.py | AnotherSamWilson/miceForest | 3 | 6624624 |
from sklearn.datasets import load_boston
import pandas as pd
import numpy as np
import miceforest as mf
from datetime import datetime
from miceforest.mean_matching_functions import mean_match_kdtree_classification
from matplotlib.pyplot import close
# Make random state and load data
# Define data
random_state = np.ra... |
from sklearn.datasets import load_boston
import pandas as pd
import numpy as np
import miceforest as mf
from datetime import datetime
from miceforest.mean_matching_functions import mean_match_kdtree_classification
from matplotlib.pyplot import close
# Make random state and load data
# Define data
random_state = np.ra... | en | 0.960583 | # Make random state and load data # Define data # Run mice for 2 iterations # Generate and impute new data as a reordering of original # Expect deterministic imputations at the record level, since seeds were passed. # Generate and impute new data as a subset of original # Expect deterministic imputations at the record ... | 2.735638 | 3 |
scilla-benchmarks/evm-benchmark/benchmark_plans.py | AmritKumar/scilla-benchmarks | 1 | 6624625 | import sys
import random
import utils
from utils import ContractFunction, get_addresses, get_random_address,\
get_random_number, addresses, SENDER_ADDRESS
from evm_tools import perform_transaction
total_token_supply = 1000000 * 10**16
TRANSACTION_LIMIT = 100
TEST_ITERATIONS = 100
if len(sys.argv) != 4:
prin... | import sys
import random
import utils
from utils import ContractFunction, get_addresses, get_random_address,\
get_random_number, addresses, SENDER_ADDRESS
from evm_tools import perform_transaction
total_token_supply = 1000000 * 10**16
TRANSACTION_LIMIT = 100
TEST_ITERATIONS = 100
if len(sys.argv) != 4:
prin... | en | 0.21959 | # ('uint256', 'string', 'string'), # (total_token_supply, 'Test', 'TEST'), # { # 'function': ContractFunction('transfer', ('address', 'uint256', 'address[]')), # 'values': (addr, 1*(10**16), addresses), # 'caller': SENDER_ADDRESS, # } # for addr in addresses[:TRANSACTION_LIMIT] # { # 'test_name': 'appr... | 2.088713 | 2 |
hw5-kde-plot-density.py | ardihikaru/mlsp | 0 | 6624626 | # library: pip install KDEpy
# Source: https://github.com/tommyod/KDEpy
# Docs: https://kdepy.readthedocs.io/en/latest/
'''
By performing PCA, we can analyze why reducing PCA component can reduce the accuracy of KDE calculation.
'''
from sklearn.decomposition import PCA
from KDEpy import FFTKDE
from hw5.libs.common.... | # library: pip install KDEpy
# Source: https://github.com/tommyod/KDEpy
# Docs: https://kdepy.readthedocs.io/en/latest/
'''
By performing PCA, we can analyze why reducing PCA component can reduce the accuracy of KDE calculation.
'''
from sklearn.decomposition import PCA
from KDEpy import FFTKDE
from hw5.libs.common.... | en | 0.558269 | # library: pip install KDEpy # Source: https://github.com/tommyod/KDEpy # Docs: https://kdepy.readthedocs.io/en/latest/ By performing PCA, we can analyze why reducing PCA component can reduce the accuracy of KDE calculation. # dataset = Dataset(train_data=1000, test_data=100) # dataset = Dataset(train_data=40, test_dat... | 3.593008 | 4 |
airzone/utils.py | Mike-de-bike/python-airzone | 8 | 6624627 | <gh_stars>1-10
import base64
def bitfield(n):
'''
Obtains the binary array from the number
'''
return [1 if digit=='1' else 0 for digit in bin(n)[2:]]
def shifting(bitlist):
'''
Obtain the number from the binary array
'''
out = 0
for bit in bitlist:
out = (out << 1) | bit
... | import base64
def bitfield(n):
'''
Obtains the binary array from the number
'''
return [1 if digit=='1' else 0 for digit in bin(n)[2:]]
def shifting(bitlist):
'''
Obtain the number from the binary array
'''
out = 0
for bit in bitlist:
out = (out << 1) | bit
return out
... | en | 0.716642 | Obtains the binary array from the number Obtain the number from the binary array # toggleBit() returns an integer with the bit at 'offset' inverted, 0 -> 1 and 1 -> 0. # setBit() returns an integer with the bit at 'offset' set to 1. # clearBit() returns an integer with the bit at 'offset' cleared. | 3.645576 | 4 |
elysianfields/__init__.py | readmodifywrite/elysianfields | 0 | 6624628 |
from .fields import * |
from .fields import * | none | 1 | 1.171345 | 1 | |
python/tvm/auto_scheduler/workload_registry.py | maxtnuk/incubator-tvm | 2 | 6624629 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | en | 0.657889 | # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u... | 2.079905 | 2 |
GmailWrapper_JE/venv/Lib/site-packages/pyasn1_modules/rfc3281.py | JE-Chen/je_old_repo | 2 | 6624630 | <filename>GmailWrapper_JE/venv/Lib/site-packages/pyasn1_modules/rfc3281.py
# coding: utf-8
#
# This file is part of pyasn1-modules software.
#
# Created by <NAME> with asn1ate tool.
# Copyright (c) 2005-2019, <NAME> <<EMAIL>>
# License: http://snmplabs.com/pyasn1/license.html
#
# An Internet Attribute Certifica... | <filename>GmailWrapper_JE/venv/Lib/site-packages/pyasn1_modules/rfc3281.py
# coding: utf-8
#
# This file is part of pyasn1-modules software.
#
# Created by <NAME> with asn1ate tool.
# Copyright (c) 2005-2019, <NAME> <<EMAIL>>
# License: http://snmplabs.com/pyasn1/license.html
#
# An Internet Attribute Certifica... | en | 0.688066 | # coding: utf-8 # # This file is part of pyasn1-modules software. # # Created by <NAME> with asn1ate tool. # Copyright (c) 2005-2019, <NAME> <<EMAIL>> # License: http://snmplabs.com/pyasn1/license.html # # An Internet Attribute Certificate Profile for Authorization # # ASN.1 source from: # http://www.ietf.org/rfc/rfc32... | 2.050237 | 2 |
skill_discovery/hierarchical_agglomoration.py | UT-Austin-RPL/BUDS | 9 | 6624631 | <filename>skill_discovery/hierarchical_agglomoration.py
"""Hierarchical agglomoration"""
import os
import argparse
import h5py
import numpy as np
import simplejson as json
from sklearn.cluster import SpectralClustering
from PIL import Image
import cv2
import shutil
import pickle
from collections import namedtuple
... | <filename>skill_discovery/hierarchical_agglomoration.py
"""Hierarchical agglomoration"""
import os
import argparse
import h5py
import numpy as np
import simplejson as json
from sklearn.cluster import SpectralClustering
from PIL import Image
import cv2
import shutil
import pickle
from collections import namedtuple
... | en | 0.402482 | Hierarchical agglomoration # In the beginning # At tail # label = find_most_frequent_element(labels) # if args.skip: # if os.path.exists(f"skill_classification/trees/{args.dataset_name}_trees_{modality_str}_{args.footprint}_{args.dist}.pkl"): # print("Already constructed, skipping") # exit() # print... | 2.372501 | 2 |
setup-build.py | lights-a5/a-rtfc | 0 | 6624632 | #!/usr/bin/python3
import configparser
from os import walk
class Setup_preparer:
translate_dict = {}
def __init__(self, translate_dict_filepath):
config = configparser.ConfigParser()
config.read(translate_dict_filepath)
for key in config["build_config"]:
self.translate_dict... | #!/usr/bin/python3
import configparser
from os import walk
class Setup_preparer:
translate_dict = {}
def __init__(self, translate_dict_filepath):
config = configparser.ConfigParser()
config.read(translate_dict_filepath)
for key in config["build_config"]:
self.translate_dict... | fr | 0.386793 | #!/usr/bin/python3 | 2.369756 | 2 |
backend/accounts/api.py | aibek79/Django-React-knboard | 665 | 6624633 | <reponame>aibek79/Django-React-knboard
import uuid
import shortuuid
from dj_rest_auth.registration.views import RegisterView
from django.conf import settings
from django.contrib.auth import get_user_model
from rest_framework import filters
from rest_framework import mixins
from rest_framework.decorators import action
... | import uuid
import shortuuid
from dj_rest_auth.registration.views import RegisterView
from django.conf import settings
from django.contrib.auth import get_user_model
from rest_framework import filters
from rest_framework import mixins
from rest_framework.decorators import action
from rest_framework.exceptions import P... | en | 0.973785 | Filter that only shows members that are not a member of board. Don't want to make scraping users too easy. So there are some limits for this search endpoint. 1) The search must have at least 3 characters 2) A fixed low amount of users are returned at most | 2.034262 | 2 |
server/app/util/data_locator.py | hy395/cellxgene | 0 | 6624634 | <filename>server/app/util/data_locator.py<gh_stars>0
import os
import tempfile
import fsspec
from datetime import datetime
class DataLocator():
"""
DataLocator is a simple wrapper around fsspec functionality, and provides a
set of functions to encapsulate a data location (URI or path), interogate
meta... | <filename>server/app/util/data_locator.py<gh_stars>0
import os
import tempfile
import fsspec
from datetime import datetime
class DataLocator():
"""
DataLocator is a simple wrapper around fsspec functionality, and provides a
set of functions to encapsulate a data location (URI or path), interogate
meta... | en | 0.78462 | DataLocator is a simple wrapper around fsspec functionality, and provides a set of functions to encapsulate a data location (URI or path), interogate metadata about the object at that location (size, existance, etc) and access the underlying data. https://filesystem-spec.readthedocs.io/en/latest/index.... | 3.329668 | 3 |
stumpy/aamp_motifs.py | TDAmeritrade/stumpy | 2,296 | 6624635 | <reponame>TDAmeritrade/stumpy<gh_stars>1000+
# STUMPY
# Copyright 2019 TD Ameritrade. Released under the terms of the 3-Clause BSD license.
# STUMPY is a trademark of TD Ameritrade IP Company, Inc. All rights reserved.
import logging
import numpy as np
from . import core, config
logger = logging.getLogger(__name__)... | # STUMPY
# Copyright 2019 TD Ameritrade. Released under the terms of the 3-Clause BSD license.
# STUMPY is a trademark of TD Ameritrade IP Company, Inc. All rights reserved.
import logging
import numpy as np
from . import core, config
logger = logging.getLogger(__name__)
def _aamp_motifs(
T,
P,
T_subs... | en | 0.815879 | # STUMPY # Copyright 2019 TD Ameritrade. Released under the terms of the 3-Clause BSD license. # STUMPY is a trademark of TD Ameritrade IP Company, Inc. All rights reserved. Find the top non-normalized motifs (i.e., without z-normalization) for time series `T`. A subsequence, `Q`, becomes a candidate motif if ... | 2.139571 | 2 |
fastapi_mail/msg.py | gogoku/fastapi-mail | 3 | 6624636 | import time
import sys
from email.mime.text import MIMEText
from email.mime.base import MIMEBase
from email.mime.multipart import MIMEMultipart
from email.utils import formatdate, make_msgid
from email.encoders import encode_base64
PY3 = sys.version_info[0] == 3
class MailMsg:
"""
Preaparation of class for e... | import time
import sys
from email.mime.text import MIMEText
from email.mime.base import MIMEBase
from email.mime.multipart import MIMEMultipart
from email.utils import formatdate, make_msgid
from email.encoders import encode_base64
PY3 = sys.version_info[0] == 3
class MailMsg:
"""
Preaparation of class for e... | en | 0.562406 | Preaparation of class for email text :param subject: email subject header :param recipients: list of email addresses :param body: plain text message :param html: HTML message :param subtype: type of body parameter - "plain" or "html". Ignored if the html parameter is explicitly specified :p... | 2.744729 | 3 |
tests/postgres_tests/test_json.py | Robin2555/Django_Bib | 4 | 6624637 | import datetime
import operator
import uuid
from decimal import Decimal
from django.core import checks, exceptions, serializers
from django.core.serializers.json import DjangoJSONEncoder
from django.db import connection
from django.db.models import Count, F, OuterRef, Q, Subquery
from django.db.models.expressions impo... | import datetime
import operator
import uuid
from decimal import Decimal
from django.core import checks, exceptions, serializers
from django.core.serializers.json import DjangoJSONEncoder
from django.db import connection
from django.db.models import Count, F, OuterRef, Q, Subquery
from django.db.models.expressions impo... | en | 0.688887 | JSONModel.field_custom has a custom DjangoJSONEncoder. # key__isnull works the same as has_key='key'. field__test' = '"a"') OR 1 = 1 OR ('d ."field" -> 'test'' = ''"a"'') OR 1 = 1 OR (''d') = '"x"' # (Python value, serialized value), When displaying a bound form (typically due to invalid input), the form should... | 2.203234 | 2 |
resources/tests/test_reservation_api.py | haltu/hmlvaraus-backend | 1 | 6624638 | import pytest
import datetime
import re
from django.contrib.auth import get_user_model
from django.core.urlresolvers import reverse
from django.core import mail
from django.test.utils import override_settings
from django.utils import dateparse, timezone
from guardian.shortcuts import assign_perm
from freezegun import f... | import pytest
import datetime
import re
from django.contrib.auth import get_user_model
from django.core.urlresolvers import reverse
from django.core import mail
from django.test.utils import override_settings
from django.utils import dateparse, timezone
from guardian.shortcuts import assign_perm
from freezegun import f... | en | 0.947105 | Tests that PUT, PATCH and DELETE aren't allowed to reservation list endpoint. Tests that an unauthenticated user cannot create a reservation. Tests that an authenticated user can create a reservation. Tests that an authenticated user can modify her own reservation Tests that an authenticated user can delete her own res... | 1.900383 | 2 |
phs_adventure.py | ehmatthes/phs_adventure | 2 | 6624639 | <filename>phs_adventure.py
import os
import sys
import engine
# Overall approach: show a message, then show choices,
# then respond to choices
while 1:
# Start the adventure.
os.system('clear')
message = "You are standing at the entrance to the new Pacific High School."
choices = {}
choices['1... | <filename>phs_adventure.py
import os
import sys
import engine
# Overall approach: show a message, then show choices,
# then respond to choices
while 1:
# Start the adventure.
os.system('clear')
message = "You are standing at the entrance to the new Pacific High School."
choices = {}
choices['1... | en | 0.837711 | # Overall approach: show a message, then show choices, # then respond to choices # Start the adventure. # Respond to first choice. # You know the secret! # You know the secret! # phil's desk # eric's room | 3.937984 | 4 |
python/ccxt/yobit.py | yufengwei/xex-dev | 0 | 6624640 | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.liqui import liqui
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import AuthenticationError
from ccxt.base.err... | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.liqui import liqui
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import AuthenticationError
from ccxt.base.err... | en | 0.676731 | # -*- coding: utf-8 -*- # PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN: # https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code # responses are cached every 2 seconds # what is self, a coin for ants? # they just change the ticker if it is already taken # {"success": 0,... | 1.655913 | 2 |
key_word_num/json_handle.py | Carrie2001/Chinese-poems-generation-based-on-pictures | 1 | 6624641 | # coding UTF-8
# 该程序用于把https://github.com/chinese-poetry/chinese-poetry上的古诗json数据转化成txt并从中筛选五言诗句
import json
import os
# 5言诗
length = 5
length += 1
length *= 2
tfilename = '唐诗'
files = os.listdir(tfilename)
all_list = []
# 把这些诗句写入list
for name in files:
filename = tfilename + '/'
filename += n... | # coding UTF-8
# 该程序用于把https://github.com/chinese-poetry/chinese-poetry上的古诗json数据转化成txt并从中筛选五言诗句
import json
import os
# 5言诗
length = 5
length += 1
length *= 2
tfilename = '唐诗'
files = os.listdir(tfilename)
all_list = []
# 把这些诗句写入list
for name in files:
filename = tfilename + '/'
filename += n... | zh | 0.319235 | # coding UTF-8 # 该程序用于把https://github.com/chinese-poetry/chinese-poetry上的古诗json数据转化成txt并从中筛选五言诗句 # 5言诗 # 把这些诗句写入list # print(tmp_list[2][0]) # print(len(tmp_list[2][0])) # print(len(tmp_list[2])) # 把list存入文档 | 2.979715 | 3 |
client/build/build_rocketbox_materials.py | AustralianDisabilityLimited/MultiversePlatform | 33 | 6624642 | #
# The Multiverse Platform is made available under the MIT License.
#
# Copyright (c) 2012 The Multiverse Foundation
#
# 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 restrict... | #
# The Multiverse Platform is made available under the MIT License.
#
# Copyright (c) 2012 The Multiverse Foundation
#
# 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 restrict... | en | 0.628072 | # # The Multiverse Platform is made available under the MIT License. # # Copyright (c) 2012 The Multiverse Foundation # # 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 restrictio... | 1.455451 | 1 |
electrum/lntransport.py | git-sgmoore/electrum | 1 | 6624643 | # Copyright (C) 2018 <NAME> (waxwing)
# Copyright (C) 2018 The Electrum developers
# Distributed under the MIT software license, see the accompanying
# file LICENCE or http://www.opensource.org/licenses/mit-license.php
# Derived from https://gist.github.com/AdamISZ/046d05c156aaeb56cc897f85eecb3eb8
import hashlib
impo... | # Copyright (C) 2018 <NAME> (waxwing)
# Copyright (C) 2018 The Electrum developers
# Distributed under the MIT software license, see the accompanying
# file LICENCE or http://www.opensource.org/licenses/mit-license.php
# Derived from https://gist.github.com/AdamISZ/046d05c156aaeb56cc897f85eecb3eb8
import hashlib
impo... | en | 0.82565 | # Copyright (C) 2018 <NAME> (waxwing) # Copyright (C) 2018 The Electrum developers # Distributed under the MIT software license, see the accompanying # file LICENCE or http://www.opensource.org/licenses/mit-license.php # Derived from https://gist.github.com/AdamISZ/046d05c156aaeb56cc897f85eecb3eb8 BOLT 8 requires the n... | 1.896893 | 2 |
Web/Python/vtkmodules/web/render_window_serializer.py | CapLek/VTK | 0 | 6624644 | <reponame>CapLek/VTK<gh_stars>0
from __future__ import absolute_import, division, print_function
import json, time, re
from vtk.vtkFiltersGeometry import vtkCompositeDataGeometryFilter
from vtk.vtkCommonCore import vtkTypeUInt32Array
from vtk.vtkWebCore import vtkWebApplication
from vtk.numpy_interface import algorit... | from __future__ import absolute_import, division, print_function
import json, time, re
from vtk.vtkFiltersGeometry import vtkCompositeDataGeometryFilter
from vtk.vtkCommonCore import vtkTypeUInt32Array
from vtk.vtkWebCore import vtkWebApplication
from vtk.numpy_interface import algorithms
from vtk.numpy_interface imp... | en | 0.28282 | # ----------------------------------------------------------------------------- # Convenience class for caching data arrays, storing computed sha sums, keeping # track of valid actors, etc... # ----------------------------------------------------------------------------- # IdType need to be converted to Uint32 # Conver... | 1.847409 | 2 |
examples/to_replace/sessions/tx_sessions.py | devdave/txWeb | 0 | 6624645 |
import time
import webbrowser
from txweb import Site as Site
from txweb import expose
from twisted.web.static import File
from twisted.internet import reactor, defer
from twisted.web.server import NOT_DONE_YET
class Root(object):
landing_page = File("./landing_page.html")
home_page = File("./h... |
import time
import webbrowser
from txweb import Site as Site
from txweb import expose
from twisted.web.static import File
from twisted.internet import reactor, defer
from twisted.web.server import NOT_DONE_YET
class Root(object):
landing_page = File("./landing_page.html")
home_page = File("./h... | en | 0.229299 | # from dbgp.client import brk; brk("192.168.1.2", 9090) # from dbgp.client import brk; brk("192.168.1.2", 9090) | 2.498728 | 2 |
fantasyProjectHome/fantasyApp/views.py | jaredtewodros/cfbFantasyApp | 0 | 6624646 | <gh_stars>0
from django.shortcuts import render
# Create your views here.
def index(request):
return render(request, 'fantasyApp/index.html', {})
def login(request):
return render(request, 'fantasyApp/login.html', {}) | from django.shortcuts import render
# Create your views here.
def index(request):
return render(request, 'fantasyApp/index.html', {})
def login(request):
return render(request, 'fantasyApp/login.html', {}) | en | 0.968116 | # Create your views here. | 1.754787 | 2 |
setup.py | Zagrebelin/py-moneyed | 0 | 6624647 | #!/usr/bin/env python
from setuptools import setup
from setuptools.command.test import test as TestCommand
import sys
class Tox(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
# impor... | #!/usr/bin/env python
from setuptools import setup
from setuptools.command.test import test as TestCommand
import sys
class Tox(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
# impor... | en | 0.756797 | #!/usr/bin/env python # import here, cause outside the eggs aren't loaded | 2.020488 | 2 |
built-in/PyTorch/Official/cv/image_object_detection/Faster_Mask_RCNN_for_PyTorch_Dynamic_Shape/detectron2/evaluation/cityscapes_evaluation.py | Ascend/modelzoo | 12 | 6624648 | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
# Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.... | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
# Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.... | en | 0.83532 | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved # Copyright 2020 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.... | 1.615029 | 2 |
servermanager/api/blogapi.py | clpolcurs/TungBlog | 0 | 6624649 | from haystack.query import SearchQuerySet
from blog.models import Article, Category
class BlogApi:
def __init__(self):
self.searchqueryset = SearchQuerySet()
self.searchqueryset.auto_query('')
self.__max_takecount__ = 8
def search_articles(self, query):
sqs = self.searchquery... | from haystack.query import SearchQuerySet
from blog.models import Article, Category
class BlogApi:
def __init__(self):
self.searchqueryset = SearchQuerySet()
self.searchqueryset.auto_query('')
self.__max_takecount__ = 8
def search_articles(self, query):
sqs = self.searchquery... | none | 1 | 2.493907 | 2 | |
microsoft_screenshot.py | Vignesh-Desmond/screenshot-discord | 4 | 6624650 | <reponame>Vignesh-Desmond/screenshot-discord
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import discord
from discord.ext import commands, tasks
import asyncio
from PIL import Image, ImageEnhance, ImageFilter, ImageGrab
from io import BytesIO
import keyboard
from datetime import datetime
import pytz
import numpy as ... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import discord
from discord.ext import commands, tasks
import asyncio
from PIL import Image, ImageEnhance, ImageFilter, ImageGrab
from io import BytesIO
import keyboard
from datetime import datetime
import pytz
import numpy as np
import os
from dotenv import load_dotenv
... | en | 0.352855 | #!/usr/bin/env python # -*- coding: utf-8 -*- | 2.5101 | 3 |