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 |
|---|---|---|---|---|---|---|---|---|---|---|
python3/136.single-number.313124299.ac.py | Diego-Zulu/leetcode_answers | 0 | 6628451 | #
# @lc app=leetcode id=136 lang=python3
#
# [136] Single Number
#
# https://leetcode.com/problems/single-number/description/
#
# algorithms
# Easy (64.86%)
# Likes: 4161
# Dislikes: 154
# Total Accepted: 829.6K
# Total Submissions: 1.3M
# Testcase Example: '[2,2,1]'
#
# Given a non-empty array of integers, ever... | #
# @lc app=leetcode id=136 lang=python3
#
# [136] Single Number
#
# https://leetcode.com/problems/single-number/description/
#
# algorithms
# Easy (64.86%)
# Likes: 4161
# Dislikes: 154
# Total Accepted: 829.6K
# Total Submissions: 1.3M
# Testcase Example: '[2,2,1]'
#
# Given a non-empty array of integers, ever... | en | 0.705327 | # # @lc app=leetcode id=136 lang=python3 # # [136] Single Number # # https://leetcode.com/problems/single-number/description/ # # algorithms # Easy (64.86%) # Likes: 4161 # Dislikes: 154 # Total Accepted: 829.6K # Total Submissions: 1.3M # Testcase Example: '[2,2,1]' # # Given a non-empty array of integers, ever... | 3.402506 | 3 |
NAS/APS-channel-search/utils/compute_flops.py | naviocean/SimpleCVReproduction | 923 | 6628452 | <reponame>naviocean/SimpleCVReproduction<filename>NAS/APS-channel-search/utils/compute_flops.py
# Code from https://github.com/simochen/model-tools.
import numpy as np
import pdb
import torch
import torchvision
import torch.nn as nn
import numpy as np
import random
def lookup_table_flops(model, candidate_width, alpha... | # Code from https://github.com/simochen/model-tools.
import numpy as np
import pdb
import torch
import torchvision
import torch.nn as nn
import numpy as np
import random
def lookup_table_flops(model, candidate_width, alphas=None, input_res=32, multiply_adds=False):
if alphas is None:
for n, v in model.nam... | en | 0.543994 | # Code from https://github.com/simochen/model-tools. # obtain the feature map sizes # print('alphas:', alphas) # print('inputs:', input_) # TODO: only appliable for resnet_20s: 2 convs followed by 1 shortcut # start compute flops for each branch # first obtain the kernel shapes, a list of length: num_width + num_width*... | 2.173157 | 2 |
areas/models.py | chandojo/climbbeta | 1 | 6628453 | <gh_stars>1-10
from django.core.validators import validate_image_file_extension
from django.db import models
from django.urls import reverse
from django.utils.text import slugify
from api.vimeo import *
from api.google.geolocator.requests import *
class State(models.Model):
name = models.CharField(max_length=20... | from django.core.validators import validate_image_file_extension
from django.db import models
from django.urls import reverse
from django.utils.text import slugify
from api.vimeo import *
from api.google.geolocator.requests import *
class State(models.Model):
name = models.CharField(max_length=200)
abbrv = ... | none | 1 | 2.229688 | 2 | |
test_db.py | kai-jinny/Agile-Development-Project | 2 | 6628454 | <filename>test_db.py<gh_stars>1-10
# from flask import Flask
# from flask_sqlalchemy import SQLAlchemy
# from sqlalchemy.sql import text
# import os
# basedir = os.path.abspath(os.path.dirname(__file__))
# app = Flask(__name__)
# # change to name of your database; add path if necessary
# db_name = 'app.db'
# app.co... | <filename>test_db.py<gh_stars>1-10
# from flask import Flask
# from flask_sqlalchemy import SQLAlchemy
# from sqlalchemy.sql import text
# import os
# basedir = os.path.abspath(os.path.dirname(__file__))
# app = Flask(__name__)
# # change to name of your database; add path if necessary
# db_name = 'app.db'
# app.co... | en | 0.435376 | # from flask import Flask # from flask_sqlalchemy import SQLAlchemy # from sqlalchemy.sql import text # import os # basedir = os.path.abspath(os.path.dirname(__file__)) # app = Flask(__name__) # # change to name of your database; add path if necessary # db_name = 'app.db' # app.config['SQLALCHEMY_DATABASE_URI'] = os.en... | 2.698393 | 3 |
setup.py | PulpCattel/jmrpc | 2 | 6628455 | <reponame>PulpCattel/jmrpc
from setuptools import setup
setup(name='jmrpc',
version='0.1',
description='A simple and high-livel JSON-RPC client library for JoinMarket.',
url='https://github.com/PulpCattel/jmrpc',
zip_safe=False,
packages=['jmrpc'],
install_requires=['aiohttp[speedup... | from setuptools import setup
setup(name='jmrpc',
version='0.1',
description='A simple and high-livel JSON-RPC client library for JoinMarket.',
url='https://github.com/PulpCattel/jmrpc',
zip_safe=False,
packages=['jmrpc'],
install_requires=['aiohttp[speedups]>=3.7.3', 'schematics>=2.... | none | 1 | 1.254762 | 1 | |
zstackwoodpecker/zstackwoodpecker/zstack_test/kvm_checker/zstack_kvm_image_checker.py | sherry546/zstack-woodpecker | 1 | 6628456 | import os
import sys
import traceback
import zstackwoodpecker.header.checker as checker_header
import zstackwoodpecker.header.image as image_header
import zstackwoodpecker.operations.resource_operations as res_ops
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_lib as test_lib
import zstack... | import os
import sys
import traceback
import zstackwoodpecker.header.checker as checker_header
import zstackwoodpecker.header.image as image_header
import zstackwoodpecker.operations.resource_operations as res_ops
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_lib as test_lib
import zstack... | en | 0.570243 | check kvm image file existencex . If it is in backup storage, return self.judge(True). If not, return self.judge(False) #https://github.com/zstackorg/zstack/issues/93#issuecomment-130935998 | 1.855205 | 2 |
user/migrations/0006_alter_verify_add_token.py | ThePokerFaCcCe/messenger | 0 | 6628457 | # Generated by Django 3.2.10 on 2022-01-03 21:26
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('user', '0005_alter_token_fields'),
]
operations = [
migrations.AddField(
model_name='verifycode',
name='token',
... | # Generated by Django 3.2.10 on 2022-01-03 21:26
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('user', '0005_alter_token_fields'),
]
operations = [
migrations.AddField(
model_name='verifycode',
name='token',
... | en | 0.800435 | # Generated by Django 3.2.10 on 2022-01-03 21:26 | 1.628454 | 2 |
wrench/synthetic/dataset_generator.py | Stranger469/wrench | 1 | 6628458 | <filename>wrench/synthetic/dataset_generator.py
from typing import Optional, Union
import numpy as np
from .syntheticdataset import BaseSyntheticGenerator
class ConditionalIndependentGenerator(BaseSyntheticGenerator):
def __init__(self,
n_class: int,
n_lfs: int,
... | <filename>wrench/synthetic/dataset_generator.py
from typing import Optional, Union
import numpy as np
from .syntheticdataset import BaseSyntheticGenerator
class ConditionalIndependentGenerator(BaseSyntheticGenerator):
def __init__(self,
n_class: int,
n_lfs: int,
... | none | 1 | 2.385055 | 2 | |
python/pylibcugraph/pylibcugraph/utilities/api_tools.py | AyodeAwe/cugraph | 0 | 6628459 | # Copyright (c) 2022, <NAME>.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | # Copyright (c) 2022, <NAME>.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | en | 0.84412 | # Copyright (c) 2022, <NAME>. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s... | 2.791401 | 3 |
src_py/rlpytorch/sampler/sampler.py | r-woo/elfai | 3,305 | 6628460 | # Copyright (c) 2018-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
from elf.options import auto_import_options, PyOptionSpec
from .sample_methods import sample_multinomial, epsilon_greed... | # Copyright (c) 2018-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
from elf.options import auto_import_options, PyOptionSpec
from .sample_methods import sample_multinomial, epsilon_greed... | en | 0.83319 | # Copyright (c) 2018-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. Initialization for Sampler. Sample an action from distribution using a certain sample method Args: ... | 2.129811 | 2 |
app/handlers/client.py | Markushik/cryptographer-bot | 0 | 6628461 | <gh_stars>0
import aioredis
import datetime
from aiogram import types, Dispatcher
from aiogram.dispatcher import FSMContext
from aiogram.types import CallbackQuery
from app.keyboard.buttons import inline_Main_Menu, inline_Methods_Menu_Page_1, inline_Methods_Menu_Page_2, \
inline_close_Active_button
from app.state... | import aioredis
import datetime
from aiogram import types, Dispatcher
from aiogram.dispatcher import FSMContext
from aiogram.types import CallbackQuery
from app.keyboard.buttons import inline_Main_Menu, inline_Methods_Menu_Page_1, inline_Methods_Menu_Page_2, \
inline_close_Active_button
from app.states.storage im... | none | 1 | 2.228271 | 2 | |
ICG-AutoExploiter/ICG-AutoExploiterBoT-006f76867be3e896ba340f8bb08ba3b5396f1cb2/files/adminTakeoverdupal.py | KC1111/Backup | 0 | 6628462 | #!/usr/bin/python
#
#
# Drupal 7.x SQL Injection SA-CORE-2014-005 https://www.drupal.org/SA-CORE-2014-005
# Inspired by yukyuk's P.o.C (https://www.reddit.com/user/fyukyuk)
#
# Tested on Drupal 7.31 with BackBox 3.x
#
# This material is intended for educational
# purposes only and the author can not be held ... | #!/usr/bin/python
#
#
# Drupal 7.x SQL Injection SA-CORE-2014-005 https://www.drupal.org/SA-CORE-2014-005
# Inspired by yukyuk's P.o.C (https://www.reddit.com/user/fyukyuk)
#
# Tested on Drupal 7.31 with BackBox 3.x
#
# This material is intended for educational
# purposes only and the author can not be held ... | en | 0.623644 | #!/usr/bin/python # # # Drupal 7.x SQL Injection SA-CORE-2014-005 https://www.drupal.org/SA-CORE-2014-005 # Inspired by yukyuk's P.o.C (https://www.reddit.com/user/fyukyuk) # # Tested on Drupal 7.31 with BackBox 3.x # # This material is intended for educational # purposes only and the author can not be held liable for ... | 2.212212 | 2 |
api/tests/test_views.py | pythonsway/library-manager | 0 | 6628463 | from datetime import datetime
from django.urls import reverse
from rest_framework.test import APITestCase
from catalog.models import Author, Book, Language
class BookListApiTest(APITestCase):
def setUp(self):
title = 'Django? Is that Spanish?'
author = Author.objects.create(name='<NAME>')
... | from datetime import datetime
from django.urls import reverse
from rest_framework.test import APITestCase
from catalog.models import Author, Book, Language
class BookListApiTest(APITestCase):
def setUp(self):
title = 'Django? Is that Spanish?'
author = Author.objects.create(name='<NAME>')
... | none | 1 | 2.599146 | 3 | |
starthinker_airflow/dags/dataset_dag.py | RMStanford/starthinker | 0 | 6628464 | ###########################################################################
#
# Copyright 2019 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org... | ###########################################################################
#
# Copyright 2019 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org... | en | 0.595092 | ########################################################################### # # Copyright 2019 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/... | 1.508122 | 2 |
registration/urls.py | Yar59/vshaurme | 1 | 6628465 | <reponame>Yar59/vshaurme
from django.conf.urls import include, url
from . import views as signup
from django.contrib.auth import views
urlpatterns = [
url(r'^accounts/signup/$', signup.user_new, name='signup'),
url(r'^accounts/login/$', views.login, name='login'),
url(r'^accounts/logout/$', views.logout, name='lo... | from django.conf.urls import include, url
from . import views as signup
from django.contrib.auth import views
urlpatterns = [
url(r'^accounts/signup/$', signup.user_new, name='signup'),
url(r'^accounts/login/$', views.login, name='login'),
url(r'^accounts/logout/$', views.logout, name='logout', kwargs={'next_page... | none | 1 | 1.782824 | 2 | |
gmm/tests/test_GMM.py | meyer-lab/tensor-gmm | 0 | 6628466 | <filename>gmm/tests/test_GMM.py<gh_stars>0
"""
Test the data import.
"""
import pandas as pd
import numpy as np
from ..imports import smallDF
from ..GMM import cvGMM
from ..scImport import import_thompson_drug
from ..tensor import vector_to_cp_pt, comparingGMM, comparingGMMjax, vector_guess, maxloglik_ptnnp, minimize_f... | <filename>gmm/tests/test_GMM.py<gh_stars>0
"""
Test the data import.
"""
import pandas as pd
import numpy as np
from ..imports import smallDF
from ..GMM import cvGMM
from ..scImport import import_thompson_drug
from ..tensor import vector_to_cp_pt, comparingGMM, comparingGMMjax, vector_guess, maxloglik_ptnnp, minimize_f... | en | 0.803833 | Test the data import. Stub test. Stub test. Test that we can go from Cp to vector, and from vector to Cp without changing values. Test that we can go from Cp to vector, and from vector to Cp without changing values. # Check that we can get a likelihood Test that we can ensures log likelihood is calculated the same Test... | 2.313782 | 2 |
REQreate/_api.py | michellqueiroz-ua/instance-generator | 1 | 6628467 | <filename>REQreate/_api.py
from generator_lines_mq_with_osmnx import retrieve_network
from passenger_requests import generate_requests
| <filename>REQreate/_api.py
from generator_lines_mq_with_osmnx import retrieve_network
from passenger_requests import generate_requests
| none | 1 | 1.228959 | 1 | |
setup.py | zapp-oz/AutoGit | 0 | 6628468 | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="reinit",
version="0.0.2",
author="<NAME>",
author_email="<EMAIL>",
description="To re-initialize and push any github repository to your own github.",
long_description=long_description,... | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="reinit",
version="0.0.2",
author="<NAME>",
author_email="<EMAIL>",
description="To re-initialize and push any github repository to your own github.",
long_description=long_description,... | none | 1 | 1.62611 | 2 | |
virtual/bin/django-admin.py | greatdaniels/awwards-app | 0 | 6628469 | #!/home/dannyboy/Documents/python/django/projects/awwards-app/virtual/bin/python
from django.core import management
if __name__ == "__main__":
management.execute_from_command_line()
| #!/home/dannyboy/Documents/python/django/projects/awwards-app/virtual/bin/python
from django.core import management
if __name__ == "__main__":
management.execute_from_command_line()
| en | 0.475228 | #!/home/dannyboy/Documents/python/django/projects/awwards-app/virtual/bin/python | 0.967866 | 1 |
python-libs/behavior.py | massimo-nocentini/competitive-programming | 2 | 6628470 | <reponame>massimo-nocentini/competitive-programming
def dispatch(*args, table, default=lambda k, e: k):
'''
Dispatch behavior in *even* positions within `args` against mapping `table`.
It accepts a variable list of arguments, however of even length, where
*hashable* objects in *even* positions are use... | def dispatch(*args, table, default=lambda k, e: k):
'''
Dispatch behavior in *even* positions within `args` against mapping `table`.
It accepts a variable list of arguments, however of even length, where
*hashable* objects in *even* positions are used in the key for dispatching against
logic contai... | en | 0.912129 | Dispatch behavior in *even* positions within `args` against mapping `table`. It accepts a variable list of arguments, however of even length, where *hashable* objects in *even* positions are used in the key for dispatching against logic container `table`, namely a mapping of functions; in parallel, objects... | 3.705069 | 4 |
tests/sentry/web/frontend/test_organization_api_key_settings.py | mitsuhiko/sentry | 4 | 6628471 | <reponame>mitsuhiko/sentry
from __future__ import absolute_import
from django.core.urlresolvers import reverse
from sentry.models import ApiKey
from sentry.testutils import TestCase, PermissionTestCase
class OrganizationApiKeySettingsPermissionTest(PermissionTestCase):
def setUp(self):
super(Organizatio... | from __future__ import absolute_import
from django.core.urlresolvers import reverse
from sentry.models import ApiKey
from sentry.testutils import TestCase, PermissionTestCase
class OrganizationApiKeySettingsPermissionTest(PermissionTestCase):
def setUp(self):
super(OrganizationApiKeySettingsPermissionTe... | none | 1 | 2.105752 | 2 | |
bookshelf/tests.py | ffkirill/library | 0 | 6628472 | <reponame>ffkirill/library<gh_stars>0
import typing
from django.core.files.uploadedfile import SimpleUploadedFile
from django.core.files import File
from rest_framework.test import APITestCase
from book.models import Book
from .models import BookshelfItem
Items = typing.List[BookshelfItem]
Books = typing.List[Book]
... | import typing
from django.core.files.uploadedfile import SimpleUploadedFile
from django.core.files import File
from rest_framework.test import APITestCase
from book.models import Book
from .models import BookshelfItem
Items = typing.List[BookshelfItem]
Books = typing.List[Book]
class BookshelfPositionTestCase(APITe... | en | 0.584851 | # Insert Item A # Insert Item B # Insert Item C between A and B # Insert Item A # Insert Item B # Insert Item A # Insert Item B # Insert Item C # Change position of C to be between A and B # Check sequence A C B # Test filters | 2.39113 | 2 |
makepy/tox.py | ubunatic/pimpy | 4 | 6628473 | <gh_stars>1-10
from makepy.shell import run, rm
import logging
log = logging.getLogger(__name__)
def tox(envlist=None):
log.info('starting tox tests for envlist: %s', envlist)
if envlist is None: run(['tox'])
else: run(['tox', '-e', envlist])
def clean(): rm('.tox')
| from makepy.shell import run, rm
import logging
log = logging.getLogger(__name__)
def tox(envlist=None):
log.info('starting tox tests for envlist: %s', envlist)
if envlist is None: run(['tox'])
else: run(['tox', '-e', envlist])
def clean(): rm('.tox') | none | 1 | 2.385447 | 2 | |
solutions/spavanac.py | dx-dt/Kattis | 0 | 6628474 | <filename>solutions/spavanac.py
# https://open.kattis.com/problems/spavanac
import sys
input = sys.stdin.read().split()
h = int(input[0])
m = int(input[1])
if m >= 45:
print h,m-45
else:
print (h-1)%24,(m-45)%60
| <filename>solutions/spavanac.py
# https://open.kattis.com/problems/spavanac
import sys
input = sys.stdin.read().split()
h = int(input[0])
m = int(input[1])
if m >= 45:
print h,m-45
else:
print (h-1)%24,(m-45)%60
| en | 0.509969 | # https://open.kattis.com/problems/spavanac | 2.697521 | 3 |
tests/test_database.py | tisnik/victimsdb-lib | 2 | 6628475 | <reponame>tisnik/victimsdb-lib<filename>tests/test_database.py
"""Tests for `victimsdb_lib.database` module."""
import pytest
from victimsdb_lib.database import VictimsDB
def test_from_dir(db_small_path):
"""Test VictimsDB.from_dir()."""
db = VictimsDB.from_dir(db_small_path)
assert db
def test_basic(d... | """Tests for `victimsdb_lib.database` module."""
import pytest
from victimsdb_lib.database import VictimsDB
def test_from_dir(db_small_path):
"""Test VictimsDB.from_dir()."""
db = VictimsDB.from_dir(db_small_path)
assert db
def test_basic(db_small_path):
"""Test VictimsDB.cves_for() for known packa... | en | 0.413626 | Tests for `victimsdb_lib.database` module. Test VictimsDB.from_dir(). Test VictimsDB.cves_for() for known package. Test VictimsDB.cves_for() for unknown package. Test VictimsDB.cves_for() YAMLs with improper/not parseable files. Test VictimsDB.java_vulnerabilities(). Test VictimsDB.javascript_vulnerabilities(). Test Vi... | 2.65703 | 3 |
examples/word2vec_similarity.py | shibing624/text2vec | 380 | 6628476 | <filename>examples/word2vec_similarity.py
# -*- coding: utf-8 -*-
"""
@author:XuMing(<EMAIL>)
@description:
"""
import sys
sys.path.append('..')
from text2vec import Similarity, cos_sim
sim = Similarity()
# Two lists of sentences
sentences1 = ['如何更换花呗绑定银行卡',
'The cat sits outside',
'A ma... | <filename>examples/word2vec_similarity.py
# -*- coding: utf-8 -*-
"""
@author:XuMing(<EMAIL>)
@description:
"""
import sys
sys.path.append('..')
from text2vec import Similarity, cos_sim
sim = Similarity()
# Two lists of sentences
sentences1 = ['如何更换花呗绑定银行卡',
'The cat sits outside',
'A ma... | en | 0.802135 | # -*- coding: utf-8 -*- @author:XuMing(<EMAIL>) @description: # Two lists of sentences # Output the pairs with their score | 3.239204 | 3 |
tensorflow_model_analysis/extractors/slice_key_extractor_test.py | hephaex/model-analysis | 2 | 6628477 | <reponame>hephaex/model-analysis<filename>tensorflow_model_analysis/extractors/slice_key_extractor_test.py
# Lint as: python3
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the ... | # Lint as: python3
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | en | 0.833855 | # Lint as: python3 # Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr... | 2.070065 | 2 |
model/graph_att_layer.py | Originofamonia/VQA_ReGAT | 0 | 6628478 | """
Copyright (c) Microsoft Corporation.
Licensed under the MIT license.
Relation-aware Graph Attention Network for Visual Question Answering
<NAME>, <NAME>, <NAME>, <NAME>
https://arxiv.org/abs/1903.12314
This code is written by <NAME>.
"""
import torch
import torch.nn as nn
from model.fc import FCNet
import math
f... | """
Copyright (c) Microsoft Corporation.
Licensed under the MIT license.
Relation-aware Graph Attention Network for Visual Question Answering
<NAME>, <NAME>, <NAME>, <NAME>
https://arxiv.org/abs/1903.12314
This code is written by <NAME>.
"""
import torch
import torch.nn as nn
from model.fc import FCNet
import math
f... | en | 0.497053 | Copyright (c) Microsoft Corporation. Licensed under the MIT license. Relation-aware Graph Attention Network for Visual Question Answering <NAME>, <NAME>, <NAME>, <NAME> https://arxiv.org/abs/1903.12314 This code is written by <NAME>. Attention module with vectorized version Args: # position_embed... | 2.486784 | 2 |
Memory/Main.py | selboo/Linux-Monitor | 5 | 6628479 | #!/usr/bin/env python
#coding=utf8
from func import *
def Memory_Get_Info():
Proc_MemInfo = Read_Proc('meminfo')
Dick_MemInfo = {}
for i in Proc_MemInfo:
Dick_MemInfo[i.split()[0][0:-1]] = int(i.split()[1])
return Dick_MemInfo
def Memory(data):
Memory = Memory_Get_Info()
MemTotal = Memory['MemTotal']
Me... | #!/usr/bin/env python
#coding=utf8
from func import *
def Memory_Get_Info():
Proc_MemInfo = Read_Proc('meminfo')
Dick_MemInfo = {}
for i in Proc_MemInfo:
Dick_MemInfo[i.split()[0][0:-1]] = int(i.split()[1])
return Dick_MemInfo
def Memory(data):
Memory = Memory_Get_Info()
MemTotal = Memory['MemTotal']
Me... | ru | 0.166716 | #!/usr/bin/env python #coding=utf8 | 2.887295 | 3 |
test/test_render.py | tekknolagi/makesite-demo | 1,744 | 6628480 | import unittest
import makesite
class RenderTest(unittest.TestCase):
"""Tests for render() function."""
def test_oneline_template(self):
tpl = 'foo {{ key1 }} baz {{ key2 }}'
out = makesite.render(tpl, key1='bar', key2='qux')
self.assertEqual(out, 'foo bar baz qux')
def test_multi... | import unittest
import makesite
class RenderTest(unittest.TestCase):
"""Tests for render() function."""
def test_oneline_template(self):
tpl = 'foo {{ key1 }} baz {{ key2 }}'
out = makesite.render(tpl, key1='bar', key2='qux')
self.assertEqual(out, 'foo bar baz qux')
def test_multi... | en | 0.693953 | Tests for render() function. | 3.286943 | 3 |
final_project/languagetr.py | SV1997/xzceb-flask_eng_fr | 0 | 6628481 | <gh_stars>0
'''this module provide translation service'''
from ibm_watson import LanguageTranslatorV3
from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
APIKEY="<KEY>"
URL='''https://api.eu-gb.language-translator.watson.cloud.ibm.com/instances/a70261ee-0e59-4e9e-b460-3b7b0380c985'''
authenticator=IAMAu... | '''this module provide translation service'''
from ibm_watson import LanguageTranslatorV3
from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
APIKEY="<KEY>"
URL='''https://api.eu-gb.language-translator.watson.cloud.ibm.com/instances/a70261ee-0e59-4e9e-b460-3b7b0380c985'''
authenticator=IAMAuthenticator(... | en | 0.321213 | this module provide translation service https://api.eu-gb.language-translator.watson.cloud.ibm.com/instances/a70261ee-0e59-4e9e-b460-3b7b0380c985 This function translate english to french # mess=input("enter text: ") This function translate french to english # mess = input("enter text: ") # text=input("enter text: ") #... | 3.354475 | 3 |
Assignment 7 solution code/vigenereIC.py | RitvikKhanna/AntiKasiskiExamination | 1 | 6628482 | # Assignment 7 - Question 2,3,4 (Combined)
# Submitted By: <NAME> & <NAME>
# 1479093 & 1505703
# The line of the code
# list1 = sorted(list1, key=lambda x: x[1],reverse = True) was taken from stackoverflow - https://stackoverflow.com/questions/613183/how-do-i-sort-a-dict... | # Assignment 7 - Question 2,3,4 (Combined)
# Submitted By: <NAME> & <NAME>
# 1479093 & 1505703
# The line of the code
# list1 = sorted(list1, key=lambda x: x[1],reverse = True) was taken from stackoverflow - https://stackoverflow.com/questions/613183/how-do-i-sort-a-dict... | en | 0.722996 | # Assignment 7 - Question 2,3,4 (Combined) # Submitted By: <NAME> & <NAME> # 1479093 & 1505703 # The line of the code # list1 = sorted(list1, key=lambda x: x[1],reverse = True) was taken from stackoverflow - https://stackoverflow.com/questions/613183/how-do-i-sort-a-dictio... | 3.918746 | 4 |
packages/w3af/w3af/core/data/parsers/utils/tests/test_re_extract.py | ZooAtmosphereGroup/HelloPackages | 0 | 6628483 | <filename>packages/w3af/w3af/core/data/parsers/utils/tests/test_re_extract.py<gh_stars>0
# -*- coding: utf-8 -*-
"""
test_re_extract.py
Copyright 2019 <NAME>
This file is part of w3af, http://w3af.org/ .
w3af is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License... | <filename>packages/w3af/w3af/core/data/parsers/utils/tests/test_re_extract.py<gh_stars>0
# -*- coding: utf-8 -*-
"""
test_re_extract.py
Copyright 2019 <NAME>
This file is part of w3af, http://w3af.org/ .
w3af is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License... | en | 0.853346 | # -*- coding: utf-8 -*- test_re_extract.py Copyright 2019 <NAME> This file is part of w3af, http://w3af.org/ . w3af is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation version 2 of the License. w3af is distributed ... | 2.155723 | 2 |
ironic/tests/unit/drivers/modules/ilo/test_power.py | mpardhi23/ironic | 2 | 6628484 | # Copyright 2014 Hewlett-Packard Development Company, L.P.
# 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... | # Copyright 2014 Hewlett-Packard Development Company, L.P.
# 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... | en | 0.82379 | # Copyright 2014 Hewlett-Packard Development Company, L.P. # 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... | 1.728857 | 2 |
cofee machine/main.py | marcus1666/Python-Projects | 2 | 6628485 | from extras import MENU, resources
class machine():
def cash(self, product):
print("Please insert a coin")
quarters = int(input("How many quarters? "))
dimes = int(input("How many dimes: "))
nickles = int(input("How many nickles: "))
pennies = int(input("How many pennie... | from extras import MENU, resources
class machine():
def cash(self, product):
print("Please insert a coin")
quarters = int(input("How many quarters? "))
dimes = int(input("How many dimes: "))
nickles = int(input("How many nickles: "))
pennies = int(input("How many pennie... | zh | 0.08132 | #for latte | 4.137218 | 4 |
check_ib_switch.py | guilbaults/check_ib_switch | 1 | 6628486 | <filename>check_ib_switch.py
import re
import sys
import argparse
import logging
import subprocess
import itertools
def parse_table_hex(lines):
info = {}
for line in lines:
m = re.match(r'(.*?)\s*\| (.*)', line)
info[str(m.group(1))] = int(m.group(2), 16)
return info
def parse_table_asci... | <filename>check_ib_switch.py
import re
import sys
import argparse
import logging
import subprocess
import itertools
def parse_table_hex(lines):
info = {}
for line in lines:
m = re.match(r'(.*?)\s*\| (.*)', line)
info[str(m.group(1))] = int(m.group(2), 16)
return info
def parse_table_asci... | en | 0.808937 | # PSU Watt with 0x8 prependded # store GUID to LID mapping # received a GUID, check in node name map # Received the name, need to get the GUID from the file #{} is too slow, {} RPM'.format(i, rpm)) #{} is too fast, {} RPM'.format(i, rpm)) #{} is too high, {}C'.format( #{}, {} PN={} SN={} Rev={} FW={}, {}M'.format( | 2.693975 | 3 |
versionizer/versionizer.py | Jordan-Gillard/Versionizer | 0 | 6628487 | import logging
import os
from typing import Optional, Set
from versionizer.ast_differ import ASTDiffer
from versionizer.ast_handler import ASTHandler
from versionizer.automated_test_executor import AutomatedTestExecutor
from versionizer.automated_test_generator import AutomatedTestGenerator
from versionizer.function_n... | import logging
import os
from typing import Optional, Set
from versionizer.ast_differ import ASTDiffer
from versionizer.ast_handler import ASTHandler
from versionizer.automated_test_executor import AutomatedTestExecutor
from versionizer.automated_test_generator import AutomatedTestGenerator
from versionizer.function_n... | en | 0.835364 | # TODO: Should algorithm validation be done in the AutomatedTestGenerator? # Handle working with a single file # Handle working with an entire directory | 2.30396 | 2 |
userbot/plugins/notes.py | celovek123/SensibleUserbot | 26 | 6628488 | <reponame>celovek123/SensibleUserbot<filename>userbot/plugins/notes.py<gh_stars>10-100
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
"""notes
Available Commands:
.save... | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
"""notes
Available Commands:
.save
.listnotes
.clear"""
from telethon import events, utils
from telethon.tl import types
... | en | 0.725002 | # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. notes Available Commands: .save .listnotes .clear #(\S+)', outgoing=True)) #{name}".format(name=name)) #{a_note.note} \n"... | 2.158068 | 2 |
scoring/dictionary/IUS93.py | majazeh/risloo-samples | 0 | 6628489 | <reponame>majazeh/risloo-samples<gh_stars>0
f1 = 'factor_1'
f2 = 'factor_2'
option_numbers = 5
factors_names = ('raw',f1,f2)
factors = {
1: (f1,)
, 2: (f1,)
, 3: (f1,)
, 9: (f1,)
, 12: (f1,)
, 13: (f1,)
, 14: (f1,)
, 15: (f1,)
, 16: (f1,)
, 17: (f1,)
, 20: (f1,)
, 22... | f1 = 'factor_1'
f2 = 'factor_2'
option_numbers = 5
factors_names = ('raw',f1,f2)
factors = {
1: (f1,)
, 2: (f1,)
, 3: (f1,)
, 9: (f1,)
, 12: (f1,)
, 13: (f1,)
, 14: (f1,)
, 15: (f1,)
, 16: (f1,)
, 17: (f1,)
, 20: (f1,)
, 22: (f1,)
, 23: (f1,)
, 24: (f1,)
... | none | 1 | 1.736368 | 2 | |
02_Utilizando_Modulos/17.py | TheCarvalho/Curso-Em-Video-Python | 0 | 6628490 | <gh_stars>0
# *ex 17 = Faça um programa que leia o comprimento do cateto oposto e do cateto adjacente de um triangulo retangulo. calculo e mostre o comprimento da hiputenusa
from math import hypot
opos = float(input('Me manda o cateto oposto: '))
adj = float(input('Agora me manda o adjacente: '))
print('A hipotenusa... | # *ex 17 = Faça um programa que leia o comprimento do cateto oposto e do cateto adjacente de um triangulo retangulo. calculo e mostre o comprimento da hiputenusa
from math import hypot
opos = float(input('Me manda o cateto oposto: '))
adj = float(input('Agora me manda o adjacente: '))
print('A hipotenusa é {}'.forma... | pt | 0.730475 | # *ex 17 = Faça um programa que leia o comprimento do cateto oposto e do cateto adjacente de um triangulo retangulo. calculo e mostre o comprimento da hiputenusa | 3.945441 | 4 |
lanyue_thesis/rate_limiter/raw_data/dctcp_benchmark/RTT_threshold/1000mbps/plot.py | keqhe/phd_thesis | 2 | 6628491 | import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
from pylab import *
import matplotlib.gridspec as gridspec
#import matplotlib
matplotlib.rcParams['ps.useafm'] = True
matplotlib.rcParams['pdf.use14corefonts'] = True
matplotlib.rcParams['text.u... | import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
from pylab import *
import matplotlib.gridspec as gridspec
#import matplotlib
matplotlib.rcParams['ps.useafm'] = True
matplotlib.rcParams['pdf.use14corefonts'] = True
matplotlib.rcParams['text.u... | fr | 0.294494 | #import matplotlib #====================param================================ #====================param================================ #return (percentiles, samples) # total # print line # print 'match Gbits' #range(0, 30001, 1000) | 2.36784 | 2 |
mi/instrument/teledyne/workhorse/vadcp/driver.py | cdobs/mi-instrument | 1 | 6628492 | <reponame>cdobs/mi-instrument
import copy
import functools
import json
import time
import re
from contextlib import contextmanager
import mi.instrument.teledyne.workhorse.particles as particles
from mi.core.log import get_logger
from mi.instrument.teledyne.workhorse.pd0_parser import AdcpPd0Record
from mi.core.instrum... | import copy
import functools
import json
import time
import re
from contextlib import contextmanager
import mi.instrument.teledyne.workhorse.particles as particles
from mi.core.log import get_logger
from mi.instrument.teledyne.workhorse.pd0_parser import AdcpPd0Record
from mi.core.instrument.chunker import StringChunk... | en | 0.642129 | The protocol needs to have 2 connections, 4Beam(Master) and 5thBeam(Slave) InstrumentDriver constructor. @param evt_callback Driver process event callback. # multiple portAgentClient Construct the driver protocol state machine. Establish communications with the device via port agent / logger and constru... | 1.229998 | 1 |
temp/rnn_interface.py | deepakrana47/character-predictor | 1 | 6628493 | import numpy as np, pickle
def sample_formation(text, seq_length, map_vect):
samples = []
t_size = len(text)
for i in range(0, t_size - seq_length - 1):
x = [map_vect[j] for j in text[i: i + seq_length]]
y = [map_vect[j] for j in text[i + 1: i + seq_length + 1]]
samples.append((x, y... | import numpy as np, pickle
def sample_formation(text, seq_length, map_vect):
samples = []
t_size = len(text)
for i in range(0, t_size - seq_length - 1):
x = [map_vect[j] for j in text[i: i + seq_length]]
y = [map_vect[j] for j in text[i + 1: i + seq_length + 1]]
samples.append((x, y... | en | 0.597322 | # recurrent NN initalization # sample generation # RNN training parameter # mini_batch foramtion # mini_batch training # updating Recurrent network # sample generation # setting testing parameters # testing of RNN # selecting random sample from samples # producing output | 2.517262 | 3 |
configs/litehrnet/fcn_litehr18-without-head_512x1024_8x2_160k_cityscapes.py | Junjun2016/LiteHRNet | 12 | 6628494 | <reponame>Junjun2016/LiteHRNet
_base_ = [
'../_base_/models/fcn_litehr18-without-head.py',
'../_base_/datasets/cityscapes.py', '../_base_/default_runtime.py',
'../_base_/schedules/schedule_160k.py'
]
find_unused_parameters = True
| _base_ = [
'../_base_/models/fcn_litehr18-without-head.py',
'../_base_/datasets/cityscapes.py', '../_base_/default_runtime.py',
'../_base_/schedules/schedule_160k.py'
]
find_unused_parameters = True | none | 1 | 1.118231 | 1 | |
pygismeteo_base/models/search_by_coordinates.py | monosans/pygismeteo-base | 2 | 6628495 | from typing import List, Optional
from pydantic import BaseModel, Field
class District(BaseModel):
name: str
name_p: str = Field(..., alias="nameP")
class SubDistrict(BaseModel):
name: str
name_p: str = Field(..., alias="nameP")
class Country(BaseModel):
name: Optional[str]
code: str
... | from typing import List, Optional
from pydantic import BaseModel, Field
class District(BaseModel):
name: str
name_p: str = Field(..., alias="nameP")
class SubDistrict(BaseModel):
name: str
name_p: str = Field(..., alias="nameP")
class Country(BaseModel):
name: Optional[str]
code: str
... | none | 1 | 2.96139 | 3 | |
tests/test_utils.py | messi19950304/django-file | 889 | 6628496 | import os
from zipfile import ZipFile
from django.conf import settings
from django.core.files import File as DjangoFile
from django.test.testcases import TestCase
from tests.helpers import create_image
from filer.utils.loader import load_object
from filer.utils.zip import unzip
# Some target classes for the classl... | import os
from zipfile import ZipFile
from django.conf import settings
from django.core.files import File as DjangoFile
from django.test.testcases import TestCase
from tests.helpers import create_image
from filer.utils.loader import load_object
from filer.utils.zip import unzip
# Some target classes for the classl... | en | 0.590469 | # Some target classes for the classloading tests # Testing the classloader Tests filer.utils.loader.load() # Should return an instance # Testing the zipping/unzipping of files # Clean up the created zip file | 2.481917 | 2 |
FBA_tutorials/utils/show_map.py | HansWesterhoff/Systems_Biology_FBA_tutorial | 6 | 6628497 | <gh_stars>1-10
import escher,escher.urls,json,os
from IPython.display import HTML
def show_map(sol,map_loc,color=0):
''' Returns an escher Builder object for solution 'sol', map 'map_loc' and the supplied color scheme.
sol: the solution object containing the simulation results.
map_loc: ... | import escher,escher.urls,json,os
from IPython.display import HTML
def show_map(sol,map_loc,color=0):
''' Returns an escher Builder object for solution 'sol', map 'map_loc' and the supplied color scheme.
sol: the solution object containing the simulation results.
map_loc: filename of the... | en | 0.756942 | Returns an escher Builder object for solution 'sol', map 'map_loc' and the supplied color scheme. sol: the solution object containing the simulation results. map_loc: filename of the map json color: color scheme to use # grey to green to orange # shorthand # for some reason my typ... | 2.603073 | 3 |
bagpipe/exabgp/version.py | taheri0/MPLS-over-GRE | 94 | 6628498 | <reponame>taheri0/MPLS-over-GRE
version="2.0.8"
# Do not change the first line as it is parsed by scripts
if __name__ == '__main__':
import sys
sys.stdout.write(version)
| version="2.0.8"
# Do not change the first line as it is parsed by scripts
if __name__ == '__main__':
import sys
sys.stdout.write(version) | en | 0.985608 | # Do not change the first line as it is parsed by scripts | 1.167568 | 1 |
data/QAngaroo/qangaroo2squad.py | elyase/jack | 192 | 6628499 | import json
import sys
def load_json(path):
with open(path, 'r') as f:
return json.load(f)
def convert2SQUAD_format(hoppy_data, write_file_name):
"""
Converts QAngaroo data (hoppy_data) into SQuAD format.
The SQuAD-formatted data is written to disk at write_file_name.
Note: All given sup... | import json
import sys
def load_json(path):
with open(path, 'r') as f:
return json.load(f)
def convert2SQUAD_format(hoppy_data, write_file_name):
"""
Converts QAngaroo data (hoppy_data) into SQuAD format.
The SQuAD-formatted data is written to disk at write_file_name.
Note: All given sup... | en | 0.793152 | Converts QAngaroo data (hoppy_data) into SQuAD format. The SQuAD-formatted data is written to disk at write_file_name. Note: All given support documents per example are concatenated into one super-document. All text is lowercased. # adapt the JSON tree structure used in SQUAD. # loop over dataset # Form... | 3.121277 | 3 |
desktop/core/ext-py/PyYAML-3.09/tests/lib3/canonical.py | t3hi3x/hue | 19 | 6628500 | <filename>desktop/core/ext-py/PyYAML-3.09/tests/lib3/canonical.py
import yaml, yaml.composer, yaml.constructor, yaml.resolver
class CanonicalError(yaml.YAMLError):
pass
class CanonicalScanner:
def __init__(self, data):
if isinstance(data, bytes):
try:
data = data.decode('... | <filename>desktop/core/ext-py/PyYAML-3.09/tests/lib3/canonical.py
import yaml, yaml.composer, yaml.constructor, yaml.resolver
class CanonicalError(yaml.YAMLError):
pass
class CanonicalScanner:
def __init__(self, data):
if isinstance(data, bytes):
try:
data = data.decode('... | en | 0.519769 | # stream: STREAM-START document* STREAM-END # document: DIRECTIVE? DOCUMENT-START node # node: ALIAS | ANCHOR? TAG? (SCALAR|sequence|mapping) # sequence: SEQUENCE-START (node (ENTRY node)*)? ENTRY? SEQUENCE-END # mapping: MAPPING-START (map_entry (ENTRY map_entry)*)? ENTRY? MAPPING-END # map_entry: KEY node VALUE node | 2.251443 | 2 |
valuedispatch.py | what-studio/valuedispatch | 12 | 6628501 | <gh_stars>10-100
# -*- coding: utf-8 -*-
"""
valuedispatch
~~~~~~~~~~~~~
:mod:`valuedispatch`-like API but dispatches value instead of type.
:copyright: (c) 2015-2016 by What! Studio
:license: BSD, see LICENSE for more details.
"""
from functools import update_wrapper
__version__ = '0.0.1'
__all__ = ... | # -*- coding: utf-8 -*-
"""
valuedispatch
~~~~~~~~~~~~~
:mod:`valuedispatch`-like API but dispatches value instead of type.
:copyright: (c) 2015-2016 by What! Studio
:license: BSD, see LICENSE for more details.
"""
from functools import update_wrapper
__version__ = '0.0.1'
__all__ = ['valuedispatch']... | en | 0.501435 | # -*- coding: utf-8 -*- valuedispatch ~~~~~~~~~~~~~ :mod:`valuedispatch`-like API but dispatches value instead of type. :copyright: (c) 2015-2016 by What! Studio :license: BSD, see LICENSE for more details. # Import or define :class:`MappingProxyType`. Decorates a function to dispatch handler of the value... | 2.308673 | 2 |
src/python/director/viewerclient.py | edrumwri/director | 0 | 6628502 | <reponame>edrumwri/director<gh_stars>0
import time
import json
import os
import tempfile
import threading
from collections import defaultdict, Iterable
import numpy as np
from lcm import LCM
from robotlocomotion import viewer2_comms_t
from director.thirdparty import transformations
class ClientIDFactory(object):
... | import time
import json
import os
import tempfile
import threading
from collections import defaultdict, Iterable
import numpy as np
from lcm import LCM
from robotlocomotion import viewer2_comms_t
from director.thirdparty import transformations
class ClientIDFactory(object):
def __init__(self):
self.pid = ... | en | 0.859218 | A Visualizer is a lightweight object that contains a CoreVisualizer and a path. The CoreVisualizer does all of the work of storing geometries and publishing LCM messages. By storing the path in the Visualizer instance, we make it easy to do things like store or pass a Visualizer that draws to a sub-part... | 2.192466 | 2 |
annotations/views.py | connectik/digital-manifesto | 0 | 6628503 | <reponame>connectik/digital-manifesto
from __future__ import absolute_import, unicode_literals
from rest_framework import permissions, viewsets, views, parsers, renderers, filters
from . import models, serializers
class AnnotationRenderer(renderers.JSONRenderer):
"""
Format our JSON response so Annotator JS ... | from __future__ import absolute_import, unicode_literals
from rest_framework import permissions, viewsets, views, parsers, renderers, filters
from . import models, serializers
class AnnotationRenderer(renderers.JSONRenderer):
"""
Format our JSON response so Annotator JS will recognize it.
"""
def ren... | en | 0.78222 | Format our JSON response so Annotator JS will recognize it. View to handle all Annotator JS requests Placeholder view for use in `urlpatterns` so we can `reverse()` our API endpoint | 2.106239 | 2 |
ipapi/class_pipelines/ip_factory.py | tpmp-inra/ipso_cli | 0 | 6628504 | import inspect
import sys
import pkgutil
import ipapi.class_pipelines as class_pipelines
from ipapi.file_handlers.fh_base import file_handler_factory
from ipapi.base.ip_abstract import BaseImageProcessor
from ipapi.tools.common_functions import get_module_classes
def ipo_factory(
file_path, options=No... | import inspect
import sys
import pkgutil
import ipapi.class_pipelines as class_pipelines
from ipapi.file_handlers.fh_base import file_handler_factory
from ipapi.base.ip_abstract import BaseImageProcessor
from ipapi.tools.common_functions import get_module_classes
def ipo_factory(
file_path, options=No... | en | 0.650826 | # Build unique class list # Create temporary image wrapper to detect experiment # Select able class | 2.166619 | 2 |
onbattery.py | bzsparks/apcupsd-alert | 0 | 6628505 | <filename>onbattery.py
#!/usr/bin/env python3
import smtplib
import sqlite3
import json
from datetime import datetime
from email.mime.text import MIMEText
from contextlib import closing
def GetRequired():
with open('required.json', 'r') as fin:
return json.loads(fin.read())
def SetOutageInfo(now):
try... | <filename>onbattery.py
#!/usr/bin/env python3
import smtplib
import sqlite3
import json
from datetime import datetime
from email.mime.text import MIMEText
from contextlib import closing
def GetRequired():
with open('required.json', 'r') as fin:
return json.loads(fin.read())
def SetOutageInfo(now):
try... | en | 0.372344 | #!/usr/bin/env python3 #App Specific Password #Main | 2.487731 | 2 |
naive_bayes_mixture.py | devin040/messageSA | 0 | 6628506 | <gh_stars>0
# naive_bayes.py
# ---------------
# Licensing Information: You are free to use or extend this projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribution to the University of Illinois at Urbana-Cham... | # naive_bayes.py
# ---------------
# Licensing Information: You are free to use or extend this projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribution to the University of Illinois at Urbana-Champaign
#
# Cr... | en | 0.864806 | # naive_bayes.py # --------------- # Licensing Information: You are free to use or extend this projects for # educational purposes provided that (1) you do not distribute or publish # solutions, (2) you retain this notice, and (3) you provide clear # attribution to the University of Illinois at Urbana-Champaign # # Cr... | 2.976752 | 3 |
config.py | rauldatascience/sentiment-analysis | 2 | 6628507 | DATA_FILEPATH = "data/tweets_100k"
FEATURE_EXTRACTOR_FILEPATH = "model/feature_extractor_latest.pk"
CLASSIFIER_FILEPATH = "model/classifier_latest.pk"
LABELS = {
0: "negative",
4: "positive"
}
| DATA_FILEPATH = "data/tweets_100k"
FEATURE_EXTRACTOR_FILEPATH = "model/feature_extractor_latest.pk"
CLASSIFIER_FILEPATH = "model/classifier_latest.pk"
LABELS = {
0: "negative",
4: "positive"
}
| none | 1 | 1.246951 | 1 | |
tests/test_sqlite.py | danielerapati/dagobah | 1 | 6628508 | """ Tests on the SQLite backend """
import os
import datetime
import json
import yaml
from nose.tools import nottest
from dagobah.core.core import Dagobah
from dagobah.core.components import StrictJSONEncoder
from dagobah.backend.sqlite import SQLiteBackend
class TestSQLite(object):
@classmethod
def setup... | """ Tests on the SQLite backend """
import os
import datetime
import json
import yaml
from nose.tools import nottest
from dagobah.core.core import Dagobah
from dagobah.core.components import StrictJSONEncoder
from dagobah.backend.sqlite import SQLiteBackend
class TestSQLite(object):
@classmethod
def setup... | en | 0.487877 | Tests on the SQLite backend | 2.217814 | 2 |
0_Companies/CISCO.py | allenalvin333/Hackerrank_Interview | 2 | 6628509 | <filename>0_Companies/CISCO.py
# Cisco Preliminary Test
S,l,ini,c,m=input(),list(map(str,input().split())),[],0,0
while(m<len(S)):
x=m
while(x<len(S)):
if(S[x]!=S[m]): break
x+=1
ini.append(S[m:x])
m=x
for z in l:
m,k=0,[]
while(m<len(z)):
x=m
while(x<len(z)):
... | <filename>0_Companies/CISCO.py
# Cisco Preliminary Test
S,l,ini,c,m=input(),list(map(str,input().split())),[],0,0
while(m<len(S)):
x=m
while(x<len(S)):
if(S[x]!=S[m]): break
x+=1
ini.append(S[m:x])
m=x
for z in l:
m,k=0,[]
while(m<len(z)):
x=m
while(x<len(z)):
... | en | 0.193141 | # Cisco Preliminary Test # if(k[y]==ini[y] or k[y]*3==ini[y]): allen+=1 | 3.171659 | 3 |
forms.py | gracideas/spekcheck | 1 | 6628510 | import os
from flask import request, redirect
from flask_wtf import FlaskForm
from flask_wtf.file import FileField, FileAllowed, FileRequired
from wtforms import StringField, SubmitField, TextField, MultipleFileField
from wtforms.validators import DataRequired, Length
from werkzeug.utils import secure_filename
... | import os
from flask import request, redirect
from flask_wtf import FlaskForm
from flask_wtf.file import FileField, FileAllowed, FileRequired
from wtforms import StringField, SubmitField, TextField, MultipleFileField
from wtforms.validators import DataRequired, Length
from werkzeug.utils import secure_filename
... | en | 0.717982 | # Defines fields for new entry form | 2.378799 | 2 |
resources/mgltools_x86_64Linux2_1.5.6/MGLToolsPckgs/mglutil/gui/BasicWidgets/Tk/graphtool.py | J-E-J-S/aaRS-Pipeline | 8 | 6628511 | <reponame>J-E-J-S/aaRS-Pipeline
## Automatically adapted for numpy.oldnumeric Jul 23, 2007 by
##############################################################################
#
#
# Authors: <NAME>,<NAME>
#
#
###############################################################################
#
#
#
#
#$Id: graphtool.py,v 1... | ## Automatically adapted for numpy.oldnumeric Jul 23, 2007 by
##############################################################################
#
#
# Authors: <NAME>,<NAME>
#
#
###############################################################################
#
#
#
#
#$Id: graphtool.py,v 1.47 2007/12/04 21:28:04 vareille... | en | 0.647434 | ## Automatically adapted for numpy.oldnumeric Jul 23, 2007 by ############################################################################## # # # Authors: <NAME>,<NAME> # # ############################################################################### # # # # #$Id: graphtool.py,v 1.47 2007/12/04 21:28:04 vareille E... | 2.229406 | 2 |
imputeTSpy/kalman.py | zaenalium/imputeTSpy | 0 | 6628512 | <reponame>zaenalium/imputeTSpy<filename>imputeTSpy/kalman.py
from pykalman import KalmanFilter
import numpy as np
import pandas as pd
from check_data import check_data, consecutive
from tsAirgap import ts_airgap, ts_heating, ts_nh4
def na_kalman(data, option = "linear", maxgap = None) :
""" Missing Value Imputat... | from pykalman import KalmanFilter
import numpy as np
import pandas as pd
from check_data import check_data, consecutive
from tsAirgap import ts_airgap, ts_heating, ts_nh4
def na_kalman(data, option = "linear", maxgap = None) :
""" Missing Value Imputation by Interpolation
Uses linear, spline or stineman int... | en | 0.442255 | Missing Value Imputation by Interpolation Uses linear, spline or stineman interpolation to replace missing values. Parameters ---------- data: numpy.array, list or pandas.Series Data to impute. Returns ------- numpy.array Imputed data. Examples ------ import imputeTSpy da... | 2.955677 | 3 |
nemo/core/classes/exportable.py | hamjam/NeMo | 1 | 6628513 | <filename>nemo/core/classes/exportable.py
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/license... | <filename>nemo/core/classes/exportable.py
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/license... | en | 0.844568 | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli... | 2.262301 | 2 |
3- Strings/string-methods.py | WildGenie/Python-for-ML- | 7 | 6628514 | msg = "Python Kursumuza Ho<NAME>iniz. <NAME> TEKE"
# sonuc = msg.upper()
# sonuc = msg.lower()
# sonuc = msg.title()
# sonuc = msg.capitalize()
# sonuc = "abc".islower()
# sonuc = " abc ".strip()
# sonuc = msg.split()
# sonuc = msg.split('.')
# sonuc = "-".join(sonuc)
# index = msg.index('Hoş')
# sonuc = msg.st... | msg = "Python Kursumuza Ho<NAME>iniz. <NAME> TEKE"
# sonuc = msg.upper()
# sonuc = msg.lower()
# sonuc = msg.title()
# sonuc = msg.capitalize()
# sonuc = "abc".islower()
# sonuc = " abc ".strip()
# sonuc = msg.split()
# sonuc = msg.split('.')
# sonuc = "-".join(sonuc)
# index = msg.index('Hoş')
# sonuc = msg.st... | tr | 0.241998 | # sonuc = msg.upper() # sonuc = msg.lower() # sonuc = msg.title() # sonuc = msg.capitalize() # sonuc = "abc".islower() # sonuc = " abc ".strip() # sonuc = msg.split() # sonuc = msg.split('.') # sonuc = "-".join(sonuc) # index = msg.index('Hoş') # sonuc = msg.startswith('A') # sonuc = msg.endswith('n') | 3.271677 | 3 |
scripts/run_generate_sfs_segments.py | quanc1989/SV-ONT-Tibetan | 7 | 6628515 | <gh_stars>1-10
import json
import math
import os
import random
import configargparse
import dadi
def config_opts():
parser = configargparse.ArgumentParser(
description='run_convert_vcf_to_dadi.py',
config_file_parser_class=configargparse.YAMLConfigFileParser,
formatter_class=configargpar... | import json
import math
import os
import random
import configargparse
import dadi
def config_opts():
parser = configargparse.ArgumentParser(
description='run_convert_vcf_to_dadi.py',
config_file_parser_class=configargparse.YAMLConfigFileParser,
formatter_class=configargparse.ArgumentDefa... | en | 0.086227 | # limit_variants = 10000 # index_variant = 0 # print(line) # print(key_line,'--',val_line) # list_pops = ['TIB', 'HANN', 'HANS'] #%s start' % chrom) # pos = int(key_line.split('-')[1]) # print(key_variant,'--',datadict[chrom][key_variant],'--',str(order_pos)) #%d start' % index_bootstrap) | 2.527751 | 3 |
spyne/store/relational/override.py | edustaff/spyne | 786 | 6628516 |
#
# spyne - Copyright (C) Spyne contributors.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This libra... |
#
# spyne - Copyright (C) Spyne contributors.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This libra... | en | 0.837478 | # # spyne - Copyright (C) Spyne contributors. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This librar... | 1.641485 | 2 |
solutions/problem_240.py | bssrdf/daily-coding-problem | 0 | 6628517 | #I think, at the most, `n-1` moves should be sufficient.
class Solution(object):
def minSwapsCouples(self, row):
"""
:type row: List[int]
:rtype: int
"""
n = len(row)//2
self.count = n
roots = [i for i in range(n)]
def find(i):
while ro... | #I think, at the most, `n-1` moves should be sufficient.
class Solution(object):
def minSwapsCouples(self, row):
"""
:type row: List[int]
:rtype: int
"""
n = len(row)//2
self.count = n
roots = [i for i in range(n)]
def find(i):
while ro... | en | 0.699259 | #I think, at the most, `n-1` moves should be sufficient. :type row: List[int] :rtype: int | 3.231798 | 3 |
src/savestate.py | lohathe/ogrebattleHacking | 0 | 6628518 | <reponame>lohathe/ogrebattleHacking
import collections
import json
def extractJson(file_name):
with open(file_name, "r") as f:
return json.load(f)
ITEMS = extractJson("data/items.json")
CLASSES = extractJson("data/classes.json")
NAMES = extractJson("data/names.json")
def findInsideList(list_, key, value,... | import collections
import json
def extractJson(file_name):
with open(file_name, "r") as f:
return json.load(f)
ITEMS = extractJson("data/items.json")
CLASSES = extractJson("data/classes.json")
NAMES = extractJson("data/names.json")
def findInsideList(list_, key, value, default=None):
for el in list_:... | en | 0.849485 | # type: (bytes) -> int # type: (int) -> bytes # type: (bytes) -> str # type: (str)-> bytes # type: (bytes) -> str # type: (str) -> bytes # NOTE: 'ascii' can be a little too much conservative... # NOTE: we are returning `bytes`, and not an `array[int]`, so this function # can create some problems since they are no... | 3.255673 | 3 |
portal/assignment.py | jczimmerman/tsct-portal | 1 | 6628519 | from flask import Flask, render_template, g, redirect, url_for, Blueprint, request, session, abort
from . import db
from portal.auth import login_required, teacher_required
from . import course
bp = Blueprint("assignment", __name__)
def get_assignment(id):
user_id = session.get('user_id')
con = db.get_db(... | from flask import Flask, render_template, g, redirect, url_for, Blueprint, request, session, abort
from . import db
from portal.auth import login_required, teacher_required
from . import course
bp = Blueprint("assignment", __name__)
def get_assignment(id):
user_id = session.get('user_id')
con = db.get_db(... | en | 0.665321 | SELECT assignments.assignment_id, assignments.session_id, sessions.course_id, courses.teacherid FROM assignments JOIN sessions ON assignments.session_id = sessions.id JOIN courses ON sessions.course_id = courses.course_id WHERE assignments.assignment_id = ... | 2.649792 | 3 |
objectModel/Python/cdm/objectmodel/_document_library.py | dhoffland/CDM | 1 | 6628520 | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
import threading
from typing import Dict, List, Set, Tuple, Union, TYPE_CHECKING
if TYPE_CHECKING:
from cdm.objectmodel import CdmDocumentDefinition, CdmFolder... | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
import threading
from typing import Dict, List, Set, Tuple, Union, TYPE_CHECKING
if TYPE_CHECKING:
from cdm.objectmodel import CdmDocumentDefinition, CdmFolder... | en | 0.788465 | # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. Synchronizes all dictionaries relating to the documents (and their statuses) in the corpus. # --- internal --- # type: Set[str] # type: Set[str] # type: Set[CdmDocum... | 2.341348 | 2 |
confrm/confrm.py | confrm/confrm | 1 | 6628521 | <filename>confrm/confrm.py
"""Main FastAPI Implementation of confrm
Copyright 2020 confrm.io
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... | <filename>confrm/confrm.py
"""Main FastAPI Implementation of confrm
Copyright 2020 confrm.io
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... | en | 0.735254 | Main FastAPI Implementation of confrm Copyright 2020 confrm.io 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... | 1.88511 | 2 |
web/accounts/urls.py | GuillaumeCaillou/carbure | 0 | 6628522 | from django.urls import path
from . import views
urlpatterns = [
path('profile', views.profile, name='profile'),
path('password_change', views.custom_password_change, name='custom_password_change'),
path('password_change_success', views.custom_password_change_success, name='custom_password_change_success'... | from django.urls import path
from . import views
urlpatterns = [
path('profile', views.profile, name='profile'),
path('password_change', views.custom_password_change, name='custom_password_change'),
path('password_change_success', views.custom_password_change_success, name='custom_password_change_success'... | none | 1 | 1.63212 | 2 | |
ultrasonic-sensor/range-finder.py | lyneca/microbit-demos | 0 | 6628523 | 'An example range-finder using a ultrasonic sensor and the 25 leds'
from microbit import *
import machine
import time
TRIGGER = pin0
ECHO = pin1
ECHO.read_digital()
ECHO.set_pull(ECHO.NO_PULL)
def read_distance_cm(trigger_pin, echo_pin):
'''
Get distance in cm from an object using HC-SR04 ultrasonic sensor.
... | 'An example range-finder using a ultrasonic sensor and the 25 leds'
from microbit import *
import machine
import time
TRIGGER = pin0
ECHO = pin1
ECHO.read_digital()
ECHO.set_pull(ECHO.NO_PULL)
def read_distance_cm(trigger_pin, echo_pin):
'''
Get distance in cm from an object using HC-SR04 ultrasonic sensor.
... | en | 0.870252 | Get distance in cm from an object using HC-SR04 ultrasonic sensor. The sensor requires 5V in (doesn't operate properly on 3v). Use voltage divider to lower ECHO signal to 3v. Use a delay of at least 60ms between calls to read_distance. # 60000us timeout (max about 400cm). A larger timeout will make it possi... | 3.459886 | 3 |
Indicators/double_weighted_moving_average.py | Desil-sketch/Indicators-for-Jesse | 1 | 6628524 | from jesse.helpers import get_candle_source, slice_candles, np_shift
import numpy as np
from numba import njit
import talib
from typing import Union
from jesse.helpers import get_config, same_length, get_candle_source, slice_candles, np_shift
from collections import namedtuple
'''
https://www.tradingview.com/script/T... | from jesse.helpers import get_candle_source, slice_candles, np_shift
import numpy as np
from numba import njit
import talib
from typing import Union
from jesse.helpers import get_config, same_length, get_candle_source, slice_candles, np_shift
from collections import namedtuple
'''
https://www.tradingview.com/script/T... | en | 0.530815 | https://www.tradingview.com/script/TZNHdMDL-Double-Weighted-Moving-Average/ | 2.5315 | 3 |
survey/mixins/categorical_group_mixin.py | vahndi/quant-survey | 2 | 6628525 | <gh_stars>1-10
import matplotlib.pyplot as plt
from matplotlib.figure import Figure
from typing import List, Union, Dict, Optional, Tuple, Any
from survey.mixins.data_types.categorical_mixin import CategoricalMixin
class CategoricalGroupMixin(object):
items: List[CategoricalMixin]
def _set_categories(self)... | import matplotlib.pyplot as plt
from matplotlib.figure import Figure
from typing import List, Union, Dict, Optional, Tuple, Any
from survey.mixins.data_types.categorical_mixin import CategoricalMixin
class CategoricalGroupMixin(object):
items: List[CategoricalMixin]
def _set_categories(self):
"""
... | en | 0.782896 | Set the Categories for the Group if all Categoricals in the Group have the same Categories. Return the categories. Return the names of the categories. Return the values of the categories. Plot a grid of distributions of the group's questions. :param n_rows: Number of rows in the grid. :param n_... | 3.05656 | 3 |
cvxpy/tests/test_atoms.py | rpradal/cvxpy | 0 | 6628526 | """
Copyright 2013 <NAME>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distrib... | """
Copyright 2013 <NAME>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distrib... | en | 0.76404 | Copyright 2013 <NAME> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed... | 1.899299 | 2 |
tools/IDE/src/output_tools.py | zxpower/MansOS | 10 | 6628527 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2008-2012 the MansOS team. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice,
# ... | # -*- coding: utf-8 -*-
#
# Copyright (c) 2008-2012 the MansOS team. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice,
# ... | en | 0.658356 | # -*- coding: utf-8 -*- # # Copyright (c) 2008-2012 the MansOS team. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright notice, # ... | 1.319342 | 1 |
flaskapp/app.py | anshgandhi/Predicting_Capital_Bikeshare_bike_availability_realtime | 0 | 6628528 | from flask import Flask, flash, redirect, render_template, request, session, abort
app = Flask(__name__)
@app.route("/")
def hello():
stat = []
with open('./stations.csv', 'r') as f:
temp = f.readlines()
for i in temp:
stat.append(i.strip().split(","))
return render_template('results.... | from flask import Flask, flash, redirect, render_template, request, session, abort
app = Flask(__name__)
@app.route("/")
def hello():
stat = []
with open('./stations.csv', 'r') as f:
temp = f.readlines()
for i in temp:
stat.append(i.strip().split(","))
return render_template('results.... | en | 0.344637 | #keep_prob = tf.placeholder("float") | 2.252235 | 2 |
csgoscraper/exportplayerstatstocsv.py | sexnine/csgo_matches_scraper | 0 | 6628529 | import pickle
from csgodataclasses.csgodataclasses import *
import yaml
import csv
config = None
def load_config():
print("Loading config")
with open("../config.yml", "r") as f:
global config
config = yaml.safe_load(f)
print("Loaded config!")
def write_csv(data, file_name):
with op... | import pickle
from csgodataclasses.csgodataclasses import *
import yaml
import csv
config = None
def load_config():
print("Loading config")
with open("../config.yml", "r") as f:
global config
config = yaml.safe_load(f)
print("Loaded config!")
def write_csv(data, file_name):
with op... | none | 1 | 2.8621 | 3 | |
classes/model/layermodels/mixturemodel_usl_theano_scan.py | dennisforster/NeSi | 1 | 6628530 | # Copyright (C) 2015, <NAME> <<EMAIL>>
#
# LICENSE: THE SOFTWARE IS PROVIDED "AS IS" UNDER THE
# ACADEMIC FREE LICENSE (AFL) v3.0.
#
import theano
import theano.tensor as T
import numpy as np
from _layermodels import LayerModel_Theano_Scan
from utils.decorators import DocInherit
doc_inherit = DocInherit
#-----------... | # Copyright (C) 2015, <NAME> <<EMAIL>>
#
# LICENSE: THE SOFTWARE IS PROVIDED "AS IS" UNDER THE
# ACADEMIC FREE LICENSE (AFL) v3.0.
#
import theano
import theano.tensor as T
import numpy as np
from _layermodels import LayerModel_Theano_Scan
from utils.decorators import DocInherit
doc_inherit = DocInherit
#-----------... | en | 0.494298 | # Copyright (C) 2015, <NAME> <<EMAIL>> # # LICENSE: THE SOFTWARE IS PROVIDED "AS IS" UNDER THE # ACADEMIC FREE LICENSE (AFL) v3.0. # #------------------------------------------------------------------------------ # _input_source gives for each input variable which is not from # this layer the multilayer and the Layer o... | 2.161551 | 2 |
WolfEyes/Utils/Vector.py | TBIproject/WolfEye | 2 | 6628531 | <reponame>TBIproject/WolfEye<filename>WolfEyes/Utils/Vector.py
# -*- coding: utf-8 -*-
"""Custom weird vector, very useful."""
import numpy
import math
__all__ = [
'Vector',
]
# Plus simple pour gérer les points/vecteurs 2d
class Vector(numpy.array):
"""Some custom vector"""
# Valeur d'arrondi extrêm... | # -*- coding: utf-8 -*-
"""Custom weird vector, very useful."""
import numpy
import math
__all__ = [
'Vector',
]
# Plus simple pour gérer les points/vecteurs 2d
class Vector(numpy.array):
"""Some custom vector"""
# Valeur d'arrondi extrême
ROUND = 14
# Init
def __init__(this, *args):
... | en | 0.480514 | # -*- coding: utf-8 -*- Custom weird vector, very useful. # Plus simple pour gérer les points/vecteurs 2d Some custom vector # Valeur d'arrondi extrême # Init # Getters/Setters # ToString # Addition # Soustraction # Division # Multiplication # Puissance # Opposé Returns a new vector with same coords as current # Clone ... | 3.880875 | 4 |
reformat_gherkin/ast_node/_base.py | dcendents/reformat-gherkin | 17 | 6628532 | <reponame>dcendents/reformat-gherkin<filename>reformat_gherkin/ast_node/_base.py
from attr import dataclass
def prepare(cls=None, slots=True, frozen=True, eq=False):
"""
A common class decorator to decorate AST node classes. We can either use `@prepare`
with default parameters, or `@prepare(...)` to overr... | from attr import dataclass
def prepare(cls=None, slots=True, frozen=True, eq=False):
"""
A common class decorator to decorate AST node classes. We can either use `@prepare`
with default parameters, or `@prepare(...)` to override the default values of the
parameters. By default, `eq=False` makes the ob... | en | 0.764654 | A common class decorator to decorate AST node classes. We can either use `@prepare` with default parameters, or `@prepare(...)` to override the default values of the parameters. By default, `eq=False` makes the objects hashable, and the hash is an object's id. Therefore, every AST node is unique, even if th... | 3.159699 | 3 |
setup.py | airgproducts/euklid | 0 | 6628533 | #! /usr/bin/python
import logging
import os
import sys
import re
import platform
import subprocess
import multiprocessing
from distutils.version import LooseVersion
from distutils.core import setup
import setuptools
from setuptools.command.build_ext import build_ext
from setuptools.command.install_lib import install_... | #! /usr/bin/python
import logging
import os
import sys
import re
import platform
import subprocess
import multiprocessing
from distutils.version import LooseVersion
from distutils.core import setup
import setuptools
from setuptools.command.build_ext import build_ext
from setuptools.command.install_lib import install_... | en | 0.23328 | #! /usr/bin/python #self.include_dirs = ['euklid-stubs'] #if sys.maxsize > 2**32: # cmake_args += ['-A', 'x64'] #print(version_file.read()) | 1.862448 | 2 |
cat.pyw | ovvladimir/Animation | 2 | 6628534 | <reponame>ovvladimir/Animation
import pygame
import os
import sys
import random
import ast
from colors import COLOR
def load_images(path) -> list:
for file_name in os.listdir(path):
images_list.append(pygame.image.load(path + os.sep + file_name))
def mask():
for sp in collideGroup:
... | import pygame
import os
import sys
import random
import ast
from colors import COLOR
def load_images(path) -> list:
for file_name in os.listdir(path):
images_list.append(pygame.image.load(path + os.sep + file_name))
def mask():
for sp in collideGroup:
# collideColor = sp.image... | ru | 0.829995 | # collideColor = sp.image.get_at((30, 15)) # pygame.sprite.collide_mask # прозрачность изображения # pygame.NOFRAME # для установки прозрачности # цвет кота | 2.641851 | 3 |
edexOsgi/com.raytheon.edex.plugin.gfe/utility/common_static/base/gfe/textproducts/templates/utility/Hazard_HLS_Site_MultiPil_Definition.py | srcarter3/awips2 | 0 | 6628535 | <reponame>srcarter3/awips2
##
# This software was developed and / or modified by Raytheon Company,
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
#
# U.S. EXPORT CONTROLLED TECHNICAL DATA
# This software product contains export-restricted data whose
# export/transfer/disclosure is restricted by U.S. ... | ##
# This software was developed and / or modified by Raytheon Company,
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
#
# U.S. EXPORT CONTROLLED TECHNICAL DATA
# This software product contains export-restricted data whose
# export/transfer/disclosure is restricted by U.S. law. Dissemination
# to non... | en | 0.669679 | ## # This software was developed and / or modified by Raytheon Company, # pursuant to Contract DG133W-05-CQ-1067 with the US Government. # # U.S. EXPORT CONTROLLED TECHNICAL DATA # This software product contains export-restricted data whose # export/transfer/disclosure is restricted by U.S. law. Dissemination # to non-... | 1.102941 | 1 |
GUI/app.py | joshuamitchell192/DLS_Project | 1 | 6628536 | import configparser
import os
import sys
import threading
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QApplication
from Controllers.controller import Controller
from Models.instructions import Instructions
from Models.sampleData import SampleData
from Services.serialConnection import SerialConnection
from... | import configparser
import os
import sys
import threading
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QApplication
from Controllers.controller import Controller
from Models.instructions import Instructions
from Models.sampleData import SampleData
from Services.serialConnection import SerialConnection
from... | en | 0.818897 | # probably should use an signalling mechanism like an Event to stop gracefully QComboBox::down-arrow { image: url( ); } | 2.550504 | 3 |
tests/test_simple.py | karpierz/jtypes.pyjnius | 0 | 6628537 | from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import unittest
from jnius import JavaClass, MetaJavaClass, JavaMethod
from jnius import metaclass, java_class # <AK> for jt.jnius additions
from jnius import JavaField, JavaException # -||-
from... | from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import unittest
from jnius import JavaClass, MetaJavaClass, JavaMethod
from jnius import metaclass, java_class # <AK> for jt.jnius additions
from jnius import JavaField, JavaException # -||-
from... | ja | 0.330186 | # <AK> for jt.jnius additions # -||- # <AK> additions for jt.jnius # </AK> | 2.813461 | 3 |
qstrader/broker/portfolio/portfolio.py | tradingstrategy-ai/qstrader | 1 | 6628538 | <reponame>tradingstrategy-ai/qstrader<filename>qstrader/broker/portfolio/portfolio.py
import copy
import datetime
import logging
import pandas as pd
from qstrader import settings
from qstrader.broker.portfolio.portfolio_event import PortfolioEvent
from qstrader.broker.portfolio.position_handler import PositionHandler... | import copy
import datetime
import logging
import pandas as pd
from qstrader import settings
from qstrader.broker.portfolio.portfolio_event import PortfolioEvent
from qstrader.broker.portfolio.position_handler import PositionHandler
logger = logging.getLogger(__name__)
class Portfolio(object):
"""
Represe... | en | 0.846148 | Represents a portfolio of assets. It contains a cash account with the ability to subscribe and withdraw funds. It also contains a list of positions in assets, encapsulated by a PositionHandler instance. Parameters ---------- start_dt : datetime Portfolio creation datetime. starting_... | 2.669012 | 3 |
lib/python2.7/test/test_winreg.py | TinkerEdgeR-Android/prebuilts_python_linux-x86_2.7.5 | 2,151 | 6628539 | # Test the windows specific win32reg module.
# Only win32reg functions not hit here: FlushKey, LoadKey and SaveKey
import os, sys, errno
import unittest
from test import test_support
threading = test_support.import_module("threading")
from platform import machine
# Do this first so test will be skipped if module does... | # Test the windows specific win32reg module.
# Only win32reg functions not hit here: FlushKey, LoadKey and SaveKey
import os, sys, errno
import unittest
from test import test_support
threading = test_support.import_module("threading")
from platform import machine
# Do this first so test will be skipped if module does... | en | 0.893769 | # Test the windows specific win32reg module. # Only win32reg functions not hit here: FlushKey, LoadKey and SaveKey # Do this first so test will be skipped if module doesn't exist # Now import everything # tuple of (major, minor) # Some tests should only run on 64-bit architectures where WOW64 will be. # Starting with W... | 2.129838 | 2 |
fetchers/verifiers/OpenPGP.py | KOLANICH/fetchers.py | 1 | 6628540 | <reponame>KOLANICH/fetchers.py<filename>fetchers/verifiers/OpenPGP.py
import typing
from pathlib import Path
from . import Verifier
class OpenPGPVerifier(Verifier):
__slots__ = ("files2verify", "pgpBackend")
marker = "OpenPGP"
def __init__(self, files2verify: typing.Iterable[typing.Tuple[bytes, bytes]], backend... | import typing
from pathlib import Path
from . import Verifier
class OpenPGPVerifier(Verifier):
__slots__ = ("files2verify", "pgpBackend")
marker = "OpenPGP"
def __init__(self, files2verify: typing.Iterable[typing.Tuple[bytes, bytes]], backend=None) -> None:
self.files2verify = files2verify
if backend is Non... | none | 1 | 2.762673 | 3 | |
isic/ingest/models/metadata_file.py | ImageMarkup/isic | 0 | 6628541 | <filename>isic/ingest/models/metadata_file.py
from typing import Optional
from django.contrib.auth.models import User
from django.core.validators import FileExtensionValidator
from django.db import models
from django.db.models.query import QuerySet
import numpy as np
import pandas as pd
from s3_file_field import S3Fil... | <filename>isic/ingest/models/metadata_file.py
from typing import Optional
from django.contrib.auth.models import User
from django.core.validators import FileExtensionValidator
from django.db import models
from django.db.models.query import QuerySet
import numpy as np
import pandas as pd
from s3_file_field import S3Fil... | en | 0.567806 | # pydantic expects None for the absence of a value, not NaN # TODO: use .contains in django 4 | 1.98784 | 2 |
python/testData/paramInfo/TopLevelOverloadsAndImplementation.py | truthiswill/intellij-community | 2 | 6628542 | from typing import overload
@overload
def foo(value: None) -> None:
pass
@overload
def foo(value: int) -> str:
pass
@overload
def foo(value: str) -> str:
pass
def foo(value):
return None
foo(<arg1>) | from typing import overload
@overload
def foo(value: None) -> None:
pass
@overload
def foo(value: int) -> str:
pass
@overload
def foo(value: str) -> str:
pass
def foo(value):
return None
foo(<arg1>) | none | 1 | 2.928868 | 3 | |
tosker/graph/artifacts.py | lucarin91/tosKer | 7 | 6628543 | '''
Artifacts module
'''
class Artifact(object):
def __init__(self, name):
self.name = name
def __str__(self):
return 'Artifact'
#
# def _get_str_name(obj):
# return obj if isinstance(obj, six.string_types) else obj.name
class File(Artifact):
def __init__(self, name, abs_path):
... | '''
Artifacts module
'''
class Artifact(object):
def __init__(self, name):
self.name = name
def __str__(self):
return 'Artifact'
#
# def _get_str_name(obj):
# return obj if isinstance(obj, six.string_types) else obj.name
class File(Artifact):
def __init__(self, name, abs_path):
... | en | 0.153103 | Artifacts module # # def _get_str_name(obj): # return obj if isinstance(obj, six.string_types) else obj.name | 2.520082 | 3 |
django_town/social/management/commands/__init__.py | uptown/django-town | 0 | 6628544 | __author__ = 'uptown'
| __author__ = 'uptown'
| none | 1 | 0.973663 | 1 | |
student-projects/fall-2020/OST-Imaging-and-Matching-Plastic/mvp/ImportScanCreateImage.py | UCBerkeley-SCET/DataX-Berkeley | 28 | 6628545 | """
@author: <NAME>
"""
###########################################################################
## Import the necessary functions
###########################################################################
import sys
sys.path.append('/usr/local/lib/python2.7/site-packages')
import numpy as np
import ma... | """
@author: <NAME>
"""
###########################################################################
## Import the necessary functions
###########################################################################
import sys
sys.path.append('/usr/local/lib/python2.7/site-packages')
import numpy as np
import ma... | en | 0.65659 | @author: <NAME> ########################################################################### ## Import the necessary functions ########################################################################### ########################################################################### ## Definition of some helper functions ###... | 2.366281 | 2 |
sunpy/timeseries/timeseries_factory.py | ShubhamPandey28/sunpy | 0 | 6628546 | <gh_stars>0
"""
This module provies the `~sunpy.timeseries.TimeSeriesFactory` class.
"""
import os
import copy
import glob
import warnings
from collections import OrderedDict
from urllib.request import urlopen
import numpy as np
import pandas as pd
import astropy
import astropy.io.fits
import astropy.units as u
from ... | """
This module provies the `~sunpy.timeseries.TimeSeriesFactory` class.
"""
import os
import copy
import glob
import warnings
from collections import OrderedDict
from urllib.request import urlopen
import numpy as np
import pandas as pd
import astropy
import astropy.io.fits
import astropy.units as u
from astropy.tabl... | en | 0.712033 | This module provies the `~sunpy.timeseries.TimeSeriesFactory` class. TimeSeries(*args, **kwargs) TimeSeries factory class, used to create a variety of `~sunpy.timeseries.TimeSeries` objects. Valid timeseries types are specified by registering them with the factory. Parameters ---------- source : `... | 2.375304 | 2 |
ufo/views.py | leonrenkema/makerspaceleiden-crm | 0 | 6628547 | from django.shortcuts import render
from django.contrib.sites.shortcuts import get_current_site
from django.contrib.admin.sites import AdminSite
from django.template import loader
from django.http import HttpResponse
from django.conf import settings
from django.shortcuts import redirect
from django.views.generic import... | from django.shortcuts import render
from django.contrib.sites.shortcuts import get_current_site
from django.contrib.admin.sites import AdminSite
from django.template import loader
from django.http import HttpResponse
from django.conf import settings
from django.shortcuts import redirect
from django.views.generic import... | en | 0.885799 | # Note - we do this here; rather than in the model its save() - as this # lets admins change things through the database interface silently. # Which can help when sheparding the community. # #{}".format(url, pk) # Limit this to admins ? | 1.694074 | 2 |
scripts/schema.py | OpenPDI/pdi | 4 | 6628548 | import json
import pathlib
import tabulate
data = pathlib.Path(__file__).parents[1] / "openpdi" / "meta" / "uof"
if __name__ == "__main__":
schema_path = data.joinpath("schema.json")
with open(schema_path, "r") as s:
columns = json.load(s)
rows = []
for col in sorted(columns["fields"], key =... | import json
import pathlib
import tabulate
data = pathlib.Path(__file__).parents[1] / "openpdi" / "meta" / "uof"
if __name__ == "__main__":
schema_path = data.joinpath("schema.json")
with open(schema_path, "r") as s:
columns = json.load(s)
rows = []
for col in sorted(columns["fields"], key =... | none | 1 | 2.66662 | 3 | |
lintcode/649.py | jianershi/algorithm | 1 | 6628549 | <filename>lintcode/649.py
"""
649. Binary Tree Upside Down
https://www.lintcode.com/problem/binary-tree-upside-down/description
"""
"""
Definition of TreeNode:
class TreeNode:
def __init__(self, val):
self.val = val
self.left, self.right = None, None
"""
class Solution:
"""
@param root: the... | <filename>lintcode/649.py
"""
649. Binary Tree Upside Down
https://www.lintcode.com/problem/binary-tree-upside-down/description
"""
"""
Definition of TreeNode:
class TreeNode:
def __init__(self, val):
self.val = val
self.left, self.right = None, None
"""
class Solution:
"""
@param root: the... | en | 0.575345 | 649. Binary Tree Upside Down https://www.lintcode.com/problem/binary-tree-upside-down/description Definition of TreeNode: class TreeNode: def __init__(self, val): self.val = val self.left, self.right = None, None @param root: the root of binary tree @return: new root # write your code here #处理原始... | 3.419286 | 3 |
pool/pool_server.py | setar/pool-reference | 1 | 6628550 | <gh_stars>1-10
import asyncio
import logging
import time
import traceback
from typing import Dict, Callable, Optional
import aiohttp
from blspy import AugSchemeMPL, PrivateKey
from aiohttp import web
from chia.protocols.pool_protocol import SubmitPartial, PoolInfo
from chia.util.hash import std_hash
from chia.consensu... | import asyncio
import logging
import time
import traceback
from typing import Dict, Callable, Optional
import aiohttp
from blspy import AugSchemeMPL, PrivateKey
from aiohttp import web
from chia.protocols.pool_protocol import SubmitPartial, PoolInfo
from chia.util.hash import std_hash
from chia.consensus.default_const... | en | 0.920021 | # TODO(pool): add rate limiting # It's important that on the first request from this farmer, the default difficulty is used. Changing the # difficulty requires a few minutes, otherwise farmers can abuse by setting the difficulty right under the # proof that they found. # 10 seconds gives our node some time to get the s... | 1.961497 | 2 |